Merge lp:~htorque/libindicator/fix-small-leak into lp:libindicator/0.5

Proposed by Hernando Torque
Status: Merged
Approved by: Charles Kerr
Approved revision: 457
Merged at revision: 458
Proposed branch: lp:~htorque/libindicator/fix-small-leak
Merge into: lp:libindicator/0.5
Diff against target: 13 lines (+3/-0)
1 file modified
libindicator/indicator-image-helper.c (+3/-0)
To merge this branch: bzr merge lp:~htorque/libindicator/fix-small-leak
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+99334@code.launchpad.net

Description of the change

Fix small leak by freeing a GError.

==21624== 2,256 (384 direct, 1,872 indirect) bytes in 24 blocks are definitely lost in loss record 14,100 of 14,761
==21624== at 0x4C2B6CD: malloc (vg_replace_malloc.c:263)
==21624== by 0x6938B78: g_malloc (gmem.c:159)
==21624== by 0x694BDC2: g_slice_alloc (gslice.c:1003)
==21624== by 0x691F8D0: g_error_new_valist (gerror.c:393)
==21624== by 0x691FCAC: g_set_error (gerror.c:560)
==21624== by 0x5F21E94: gdk_pixbuf_new_from_file (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.0)
==21624== by 0x4E38AD6: refresh_image (indicator-image-helper.c:69)
==21624== by 0x6147E71: g_closure_invoke (gclosure.c:777)
==21624== by 0x6159942: signal_emit_unlocked_R (gsignal.c:3547)
==21624== by 0x616222F: g_signal_emit_valist (gsignal.c:3296)
==21624== by 0x6162471: g_signal_emit (gsignal.c:3352)
==21624== by 0x51A67F3: do_theme_change (gtkicontheme.c:719)
==21624== by 0x104AA933: icon_theme_remove_dir_from_search_path (indicator-application.c:1001)
==21624== by 0x104AAE34: theme_dir_unref (indicator-application.c:965)
==21624== by 0x104AAF79: application_removed (indicator-application.c:591)
==21624== by 0x104ABC1F: receive_signal (indicator-application.c:838)
==21624== by 0x9ACEA13: ffi_call_unix64 (unix64.S:75)
==21624== by 0x9ACE434: ffi_call (ffi64.c:486)
==21624== by 0x61486DA: g_cclosure_marshal_generic (gclosure.c:1451)
==21624== by 0x6147E71: g_closure_invoke (gclosure.c:777)
==21624== by 0x6159942: signal_emit_unlocked_R (gsignal.c:3547)
==21624== by 0x616222F: g_signal_emit_valist (gsignal.c:3296)
==21624== by 0x6162471: g_signal_emit (gsignal.c:3352)
==21624== by 0x5C8B933: on_signal_received (gdbusproxy.c:927)
==21624== by 0x5C7B004: emit_signal_instance_in_idle_cb (gdbusconnection.c:3665)
==21624== by 0x6932D89: g_main_context_dispatch (gmain.c:2515)
==21624== by 0x693314F: g_main_context_iterate.isra.23 (gmain.c:3123)
==21624== by 0x6933549: g_main_loop_run (gmain.c:3317)
==21624== by 0x51D5D8C: gtk_main (gtkmain.c:1165)
==21624== by 0x404F71: main (panel-main.c:431)

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Thanks for finding this!

Looks good, though to shrink the patch down to one line I'm going to change it to g_clear_error().

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicator/indicator-image-helper.c'
2--- libindicator/indicator-image-helper.c 2011-08-02 13:37:50 +0000
3+++ libindicator/indicator-image-helper.c 2012-03-26 14:02:42 +0000
4@@ -74,6 +74,9 @@
5
6 if (pixbuf == NULL) {
7 g_warning("Unable to load icon from file '%s' because: %s", icon_filename, error == NULL ? "I don't know" : error->message);
8+ if (error != NULL) {
9+ g_error_free(error);
10+ }
11 gtk_image_clear(image);
12 return;
13 }

Subscribers

People subscribed via source and target branches