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