multiple reference leaks in server.c
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DBus Menu |
Fix Released
|
Undecided
|
Unassigned | ||
0.4 |
Fix Released
|
Undecided
|
Unassigned | ||
0.5 |
Fix Released
|
Undecided
|
Unassigned | ||
libdbusmenu (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This bug discusses the segment of code beginning at line 1192:
http://
At 1199, we have this line:
const gchar ** props = g_variant_
According to the documentation, g_variant_get_strv returns a shallow copy of a string array, and the array itself must be freed using g_free, although the underlying strings must not be freed.
http://
The 'props' array is not freed properly, creating a memory leak. Perhaps the correct place to call g_free is at line 1212, after the code block which creates the items variant using the props data.
Below is a valgrind log illustrating the problem.
==10301== 1,873 (1,824 direct, 49 indirect) bytes in 38 blocks are definitely lost in loss record 9,093 of 9,326
==10301== at 0x4C28FAC: malloc (vg_replace_
==10301== by 0x8F62A62: g_malloc (gmem.c:164)
==10301== by 0x8F932A2: g_variant_get_strv (gvariant.c:1391)
==10301== by 0x5046045: bus_get_layout (server.c:1199)
==10301== by 0x6D1834F: call_in_idle_cb (gdbusconnectio
==10301== by 0x8F5BBCC: g_main_
==10301== by 0x8F5C3A7: g_main_
==10301== by 0x8F5C9F1: g_main_loop_run (gmain.c:3299)
==10301== by 0x416D77: main (main.c:101)
Related branches
-
Diff: 318 lines (+88/-59)3 files modifiedlibdbusmenu-glib/menuitem.c (+7/-12)
libdbusmenu-glib/server.c (+79/-47)
libdbusmenu-gtk/parser.c (+2/-0)
-
Diff: 318 lines (+88/-59)3 files modifiedlibdbusmenu-glib/menuitem.c (+7/-12)
libdbusmenu-glib/server.c (+79/-47)
libdbusmenu-gtk/parser.c (+2/-0)
- Ken VanDine: Disapprove
-
Diff: 244 lines (+69/-22)8 files modifiedChangeLog (+28/-0)
configure (+11/-11)
configure.ac (+3/-3)
debian/changelog (+10/-0)
docs/libdbusmenu-glib/reference/version.xml (+1/-1)
docs/libdbusmenu-gtk/reference/version.xml (+1/-1)
libdbusmenu-gtk/client.c (+14/-6)
libdbusmenu-gtk/genericmenuitem.c (+1/-0)
- Ken VanDine: Pending requested
-
Diff: 67319 lines (+66205/-527)110 files modified.bzrignore (+0/-229)
AUTHORS (+17/-0)
ChangeLog (+5918/-0)
Makefile.in (+821/-0)
aclocal.m4 (+10063/-0)
autogen.sh (+0/-12)
compile (+143/-0)
config.guess (+1502/-0)
config.h.in (+86/-0)
config.sub (+1714/-0)
configure (+16483/-0)
debian/changelog (+657/-0)
debian/control (+225/-0)
debian/copyright (+40/-0)
debian/gir1.2-dbusmenu-glib-0.4.install (+1/-0)
debian/gir1.2-dbusmenu-gtk-0.4.install (+1/-0)
debian/gir1.2-dbusmenu-gtk3-0.4.install (+1/-0)
debian/libdbusmenu-glib-dev.install (+6/-0)
debian/libdbusmenu-glib-doc.install (+1/-0)
debian/libdbusmenu-glib3.install (+1/-0)
debian/libdbusmenu-gtk-dev.install (+6/-0)
debian/libdbusmenu-gtk-doc.install (+1/-0)
debian/libdbusmenu-gtk3-3.install (+1/-0)
debian/libdbusmenu-gtk3-dev.install (+5/-0)
debian/libdbusmenu-gtk3.install (+1/-0)
debian/libdbusmenu-jsonloader-dev.install (+4/-0)
debian/libdbusmenu-jsonloader3.install (+1/-0)
debian/libdbusmenu-tools.install (+3/-0)
debian/rules (+45/-0)
debian/source/format (+1/-0)
debian/watch (+2/-0)
depcomp (+630/-0)
docs/Makefile.in (+613/-0)
docs/libdbusmenu-glib/Makefile.in (+613/-0)
docs/libdbusmenu-glib/reference/Makefile.in (+689/-0)
docs/libdbusmenu-glib/reference/html/annotation-glossary.html (+71/-0)
docs/libdbusmenu-glib/reference/html/api-index-full.html (+406/-0)
docs/libdbusmenu-glib/reference/html/ch01.html (+48/-0)
docs/libdbusmenu-glib/reference/html/index.html (+46/-0)
docs/libdbusmenu-glib/reference/html/index.sgml (+120/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClient.html (+427/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClientMenuitem.html (+92/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitem.html (+1326/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitemProxy.html (+154/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuServer.html (+260/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib.devhelp (+109/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib.devhelp2 (+109/-0)
docs/libdbusmenu-glib/reference/html/object-tree.html (+32/-0)
docs/libdbusmenu-glib/reference/html/style.css (+266/-0)
docs/libdbusmenu-glib/reference/tmpl/client-menuitem.sgml (+52/-0)
docs/libdbusmenu-glib/reference/tmpl/client.sgml (+168/-0)
docs/libdbusmenu-glib/reference/tmpl/menuitem-proxy.sgml (+57/-0)
docs/libdbusmenu-glib/reference/tmpl/menuitem.sgml (+520/-0)
docs/libdbusmenu-glib/reference/tmpl/server.sgml (+112/-0)
docs/libdbusmenu-glib/reference/version.xml (+1/-0)
docs/libdbusmenu-glib/reference/xml/annotation-glossary.xml (+64/-0)
docs/libdbusmenu-glib/reference/xml/api-index-deprecated.xml (+8/-0)
docs/libdbusmenu-glib/reference/xml/api-index-full.xml (+105/-0)
docs/libdbusmenu-glib/reference/xml/client-menuitem.xml (+70/-0)
docs/libdbusmenu-glib/reference/xml/client.xml (+322/-0)
docs/libdbusmenu-glib/reference/xml/menuitem-proxy.xml (+103/-0)
docs/libdbusmenu-glib/reference/xml/menuitem.xml (+915/-0)
docs/libdbusmenu-glib/reference/xml/server.xml (+199/-0)
docs/libdbusmenu-gtk/Makefile.in (+613/-0)
docs/libdbusmenu-gtk/reference/Makefile.in (+685/-0)
docs/libdbusmenu-gtk/reference/html/api-index-full.html (+122/-0)
docs/libdbusmenu-gtk/reference/html/ch01.html (+42/-0)
docs/libdbusmenu-gtk/reference/html/index.html (+39/-0)
docs/libdbusmenu-gtk/reference/html/index.sgml (+33/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-DbusmenuGtkClient.html (+316/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-DbusmenuGtkMenu.html (+169/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-menuitem.html (+256/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk.devhelp (+36/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk.devhelp2 (+36/-0)
docs/libdbusmenu-gtk/reference/html/object-tree.html (+42/-0)
docs/libdbusmenu-gtk/reference/html/style.css (+266/-0)
docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-sections.txt (+70/-0)
docs/libdbusmenu-gtk/reference/libdbusmenu-gtk.types (+3/-0)
docs/libdbusmenu-gtk/reference/tmpl/client.sgml (+115/-0)
docs/libdbusmenu-gtk/reference/tmpl/genericmenuitem.sgml (+22/-0)
docs/libdbusmenu-gtk/reference/tmpl/libdbusmenu-gtk-unused.sgml (+118/-0)
docs/libdbusmenu-gtk/reference/tmpl/menu.sgml (+67/-0)
docs/libdbusmenu-gtk/reference/tmpl/menuitem.sgml (+84/-0)
docs/libdbusmenu-gtk/reference/version.xml (+1/-0)
docs/libdbusmenu-gtk/reference/xml/api-index-deprecated.xml (+8/-0)
docs/libdbusmenu-gtk/reference/xml/api-index-full.xml (+33/-0)
docs/libdbusmenu-gtk/reference/xml/client.xml (+214/-0)
docs/libdbusmenu-gtk/reference/xml/genericmenuitem.xml (+36/-0)
docs/libdbusmenu-gtk/reference/xml/menu.xml (+118/-0)
docs/libdbusmenu-gtk/reference/xml/menuitem.xml (+165/-0)
install-sh (+520/-0)
libdbusmenu-glib/Doxyfile (+0/-257)
libdbusmenu-glib/Makefile.in (+958/-0)
libdbusmenu-glib/client-marshal.c (+131/-0)
libdbusmenu-glib/client-marshal.h (+28/-0)
libdbusmenu-glib/dbus-menu-clean.xml.c (+132/-0)
libdbusmenu-glib/dbus-menu-clean.xml.h (+1/-0)
libdbusmenu-glib/menuitem-marshal.c (+170/-0)
libdbusmenu-glib/menuitem-marshal.h (+45/-0)
libdbusmenu-glib/server-marshal.c (+164/-0)
libdbusmenu-glib/server-marshal.h (+36/-0)
libdbusmenu-gtk/Makefile.in (+1005/-0)
ltmain.sh (+8413/-0)
missing (+376/-0)
mkinstalldirs (+162/-0)
po/Makefile.in.in (+217/-0)
tests/Makefile.in (+2204/-0)
tools/Makefile.in (+858/-0)
tools/testapp/CMakeLists.txt (+0/-29)
tools/testapp/Makefile.in (+619/-0)
summary: |
- memory leak in bus_get_layout + multiple reference leaks in server.c |
tags: | added: patch |
Changed in dbusmenu: | |
status: | Fix Committed → Fix Released |
In addition, there are 3 GVariant reference leaks at the beginning of bus_get_layout.