GNOME Bugzilla – Bug 743770
Memory leak in plugman example
Last modified: 2015-02-01 16:08:00 UTC
Created attachment 295853 [details] [review] close leak Just noticed a little memory leak in the plugman example. When removing a menu entry it uses g_menu_model_get_item_attribute to get a string attribute but doesn't free the returned string. It also shows up in Valgrind: ==6428== 16 bytes in 3 blocks are definitely lost in loss record 1,913 of 9,334 ==6428== at 0x4A06BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==6428== by 0x5E2B319: g_malloc (gmem.c:97) ==6428== by 0x5E4363E: g_strdup (gstrfuncs.c:356) ==6428== by 0x5E5D407: g_variant_valist_get_nnp (gvariant.c:4743) ==6428== by 0x5E5D407: g_variant_valist_get_leaf (gvariant.c:4913) ==6428== by 0x5E5D407: g_variant_valist_get (gvariant.c:5094) ==6428== by 0x5E5E24C: g_variant_get_va (gvariant.c:5356) ==6428== by 0x58B983A: g_menu_model_get_item_attribute (gmenumodel.c:603) ==6428== by 0x402E59: disable_plugin (plugman.c:275) ==6428== by 0x402E59: enable_or_disable_plugin (plugman.c:300) ==6428== by 0x5B9A234: g_closure_invoke (gclosure.c:768) ==6428== by 0x5BAC20B: signal_emit_unlocked_R (gsignal.c:3536) ==6428== by 0x5BB4984: g_signal_emit_valist (gsignal.c:3292) ==6428== by 0x5BB4BA9: g_signal_emit (gsignal.c:3348) ==6428== by 0x4F21CA7: gtk_toggle_button_clicked (gtktogglebutton.c:606)