After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678175 - [Patch] Memory leak in GtkImage
[Patch] Memory leak in GtkImage
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-06-15 15:16 UTC by Dan Vrátil
Modified: 2012-06-20 06:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (419 bytes, patch)
2012-06-15 15:16 UTC, Dan Vrátil
needs-work Details | Review
Fixed patch (333 bytes, patch)
2012-06-18 11:12 UTC, Dan Vrátil
committed Details | Review

Description Dan Vrátil 2012-06-15 15:16:28 UTC
Created attachment 216527 [details] [review]
Fix

priv->filename is not free()'d in gtk_image_finalize() causing a memory leak
Comment 1 Matthias Clasen 2012-06-16 02:18:10 UTC
Review of attachment 216527 [details] [review]:

This is a recent regression from the iconhelper conversion.

::: gtk/gtkimage.c
@@ +370,3 @@
+      g_free (image->priv->filename);
+      image->priv->filename = NULL;
+    }

You can just do

g_free (image->priv->filename);

here. finalize can't be called more than once, and g_free handles NULL just fine.
Comment 2 Dan Vrátil 2012-06-18 11:12:52 UTC
Created attachment 216668 [details] [review]
Fixed patch

Aaah right, fixed :-)
Comment 3 Matthias Clasen 2012-06-20 00:14:05 UTC
Review of attachment 216668 [details] [review]:

looks fine
Comment 4 Dan Vrátil 2012-06-20 06:28:28 UTC
Comment on attachment 216668 [details] [review]
Fixed patch


Committed to git master as 4243c3a1e239c9f8e6fd5780ff8b00dcbbb4d41e

http://git.gnome.org/browse/gtk+/commit/?id=4243c3a1e239c9f8e6fd5780ff8b00dcbbb4d41e