memory leak in bus_get_group_properties

Bug #784873 reported by JKL
This bug report is a duplicate of:  Bug #784890: multiple reference leaks in server.c. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DBus Menu
New
Undecided
Unassigned

Bug Description

This bug discusses the segment of code beginning at line 1381 of server.c:

http://bazaar.launchpad.net/~dbusmenu-team/dbusmenu/trunk/view/head:/libdbusmenu-glib/server.c

The variant ret is created either by g_variant_builder_end or g_variant_parse. The former returns a floating reference, and the latter returns a non-floating reference. Unfortunately the call to g_variant_builder_add_value does not take over ownership of non-floating references, so the memory is not properly freed in that case.

Here is a valgrind log of nm-applet illustrating the problem.

==10301== 200 bytes in 20 blocks are definitely lost in loss record 8,473 of 9,326
==10301== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==10301== by 0x8F62A62: g_malloc (gmem.c:164)
==10301== by 0x8F9E952: g_variant_type_copy (gvarianttype.c:635)
==10301== by 0x5045E00: bus_get_group_properties (server.c:1387)
==10301== by 0x6D1834F: call_in_idle_cb (gdbusconnection.c:4434)
==10301== by 0x8F5BBCC: g_main_context_dispatch (gmain.c:2440)
==10301== by 0x8F5C3A7: g_main_context_iterate.clone.6 (gmain.c:3091)
==10301== by 0x8F5C9F1: g_main_loop_run (gmain.c:3299)
==10301== by 0x416D77: main (main.c:101)

This bug is similar to another bug I recently filed. That other bug has somewhat more detail.

https://bugs.launchpad.net/dbusmenu/+bug/784808

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.