mirror of https://github.com/GNOME/gimp.git
Bug 623169 - Memory leaks in GIMP
Add some missing g_free() and free() calls, found by cppcheck.
This commit is contained in:
parent
17a4baff01
commit
4fea27ec1d
|
@ -265,6 +265,8 @@ run (const gchar *name,
|
||||||
|
|
||||||
strncpy (info.description, name, sizeof (info.description));
|
strncpy (info.description, name, sizeof (info.description));
|
||||||
info.description[sizeof (info.description) - 1] = '\0';
|
info.description[sizeof (info.description) - 1] = '\0';
|
||||||
|
|
||||||
|
g_free (name);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (run_mode)
|
switch (run_mode)
|
||||||
|
|
|
@ -235,6 +235,8 @@ run (const gchar *name,
|
||||||
|
|
||||||
strncpy (description, name, sizeof (description));
|
strncpy (description, name, sizeof (description));
|
||||||
description[sizeof (description) - 1] = '\0';
|
description[sizeof (description) - 1] = '\0';
|
||||||
|
|
||||||
|
g_free (name);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (run_mode)
|
switch (run_mode)
|
||||||
|
|
|
@ -2122,7 +2122,11 @@ find_poly_dir (Polygon *poly,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!total)
|
if (!total)
|
||||||
return;
|
{
|
||||||
|
g_free (max_scanlines);
|
||||||
|
g_free (min_scanlines);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ((gdouble) count / (gdouble) total > COUNT_THRESHOLD)
|
if ((gdouble) count / (gdouble) total > COUNT_THRESHOLD)
|
||||||
{
|
{
|
||||||
|
|
|
@ -326,7 +326,10 @@ insert_into_tree_view (PluginBrowser *browser,
|
||||||
str_ptr = strrchr (tmp_ptr, '/');
|
str_ptr = strrchr (tmp_ptr, '/');
|
||||||
|
|
||||||
if (str_ptr == NULL)
|
if (str_ptr == NULL)
|
||||||
|
{
|
||||||
|
g_free (tmp_ptr);
|
||||||
return; /* No node */
|
return; /* No node */
|
||||||
|
}
|
||||||
|
|
||||||
leaf_ptr = g_strdup (str_ptr + 1);
|
leaf_ptr = g_strdup (str_ptr + 1);
|
||||||
|
|
||||||
|
@ -352,6 +355,8 @@ insert_into_tree_view (PluginBrowser *browser,
|
||||||
TREE_COLUMN_DATE_STRING, xtimestr,
|
TREE_COLUMN_DATE_STRING, xtimestr,
|
||||||
TREE_COLUMN_PINFO, pinfo,
|
TREE_COLUMN_PINFO, pinfo,
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
|
g_free (leaf_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1089,6 +1089,7 @@ ico_save_image (const gchar *filename,
|
||||||
|
|
||||||
ico_save_info_free (&info);
|
ico_save_info_free (&info);
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
|
g_free (entries);
|
||||||
|
|
||||||
return GIMP_PDB_SUCCESS;
|
return GIMP_PDB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1289,6 +1289,8 @@ load_save_defaults (void)
|
||||||
|
|
||||||
if (num_fields == 12)
|
if (num_fields == 12)
|
||||||
memcpy (&jsvals, &tmpvals, sizeof (tmpvals));
|
memcpy (&jsvals, &tmpvals, sizeof (tmpvals));
|
||||||
|
|
||||||
|
g_free (def_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -3135,6 +3135,7 @@ p_load_linefile (const gchar *filename,
|
||||||
l_fp = g_fopen(filename, "rb");
|
l_fp = g_fopen(filename, "rb");
|
||||||
if(l_fp == NULL)
|
if(l_fp == NULL)
|
||||||
{
|
{
|
||||||
|
g_free(l_file_buff);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
fread(l_file_buff, *len, 1, l_fp);
|
fread(l_file_buff, *len, 1, l_fp);
|
||||||
|
|
|
@ -392,4 +392,5 @@ render_rectangle (frame_spec *spec,
|
||||||
}
|
}
|
||||||
|
|
||||||
free (filter);
|
free (filter);
|
||||||
|
free (temporal_filter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,6 +209,8 @@ d_paint_star (GfigObject *obj)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
g_warning ("Internal error in star - no outer vertice point \n");
|
g_warning ("Internal error in star - no outer vertice point \n");
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
g_free (line_pnts);
|
||||||
|
g_free (min_max);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +221,8 @@ d_paint_star (GfigObject *obj)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
g_warning ("Internal error in star - no inner vertice point \n");
|
g_warning ("Internal error in star - no inner vertice point \n");
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
g_free (line_pnts);
|
||||||
|
g_free (min_max);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -357,6 +357,8 @@ ppm_load (const char *fn, ppm_t *p)
|
||||||
fread (tmpcol, p->height * p->width, 1, f);
|
fread (tmpcol, p->height * p->width, 1, f);
|
||||||
for (y = 0; y < p->width * p->height * 3; y++) {
|
for (y = 0; y < p->width * p->height * 3; y++) {
|
||||||
p->col[y] = tmpcol[y / 3];
|
p->col[y] = tmpcol[y / 3];
|
||||||
|
|
||||||
|
g_free (tmpcol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
Loading…
Reference in New Issue