Bug 623169 - Memory leaks in GIMP

Add some missing g_free() and free() calls, found by cppcheck.
This commit is contained in:
Nelson A. de Oliveira 2010-06-22 16:10:28 -03:00 committed by Sven Neumann
parent 17a4baff01
commit 4fea27ec1d
10 changed files with 25 additions and 1 deletions

View File

@ -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)

View File

@ -235,6 +235,8 @@ run (const gchar *name,
strncpy (description, name, sizeof (description));
description[sizeof (description) - 1] = '\0';
g_free (name);
}
switch (run_mode)

View File

@ -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)
{

View File

@ -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

View File

@ -1089,6 +1089,7 @@ ico_save_image (const gchar *filename,
ico_save_info_free (&info);
fclose (fp);
g_free (entries);
return GIMP_PDB_SUCCESS;
}

View File

@ -1289,6 +1289,8 @@ load_save_defaults (void)
if (num_fields == 12)
memcpy (&jsvals, &tmpvals, sizeof (tmpvals));
g_free (def_str);
}
static void

View File

@ -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);

View File

@ -392,4 +392,5 @@ render_rectangle (frame_spec *spec,
}
free (filter);
free (temporal_filter);
}

View File

@ -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;
}

View File

@ -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);