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 757299 - glib-compile-resources: do not leak c_name
glib-compile-resources: do not leak c_name
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-10-29 12:05 UTC by Roman Lebedev
Modified: 2015-12-16 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib-compile-resources: do not leak c_name (3.11 KB, patch)
2015-10-29 12:05 UTC, Roman Lebedev
committed Details | Review

Description Roman Lebedev 2015-10-29 12:05:45 UTC
Created attachment 314383 [details] [review]
glib-compile-resources: do not leak c_name

As per #578363, "if one requests e.g. strings via GOptionEntry.arg_data
then those are strduped and needs to be free'ed by the application."

Fixes following leak:

================================================================
==29426==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 10 byte(s) in 1 object(s) allocated from:
0 0x7f3ab783d37a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9437a)
1 0x7f3ab70f7c82 in g_malloc /home/lebedevri/src/glib/glib/gmem.c:94
2 0x7f3ab70f7f60 in g_malloc_n /home/lebedevri/src/glib/glib/gmem.c:330
3 0x7f3ab713258e in g_strndup /home/lebedevri/src/glib/glib/gstrfuncs.c:425
4 0x7f3ab709c86b in strdup_len /home/lebedevri/src/glib/glib/gconvert.c:864
5 0x7f3ab709c966 in g_locale_to_utf8 /home/lebedevri/src/glib/glib/gconvert.c:905
6 0x7f3ab7103c32 in parse_arg /home/lebedevri/src/glib/glib/goption.c:1276
7 0x7f3ab71066fb in parse_long_option /home/lebedevri/src/glib/glib/goption.c:1670
8 0x7f3ab7108047 in g_option_context_parse /home/lebedevri/src/glib/glib/goption.c:1997
9 0x408532 in main /home/lebedevri/src/glib/gio/glib-compile-resources.c:629
10 0x7f3ab6c72b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
Comment 1 Emmanuele Bassi (:ebassi) 2015-10-29 12:24:34 UTC
Review of attachment 314383 [details] [review]:

Okay.
Comment 2 Roman Lebedev 2015-10-29 13:30:48 UTC
As it was pointed out in IRC, i should state:
"I do not have commit rights."
Comment 3 Matthias Clasen 2015-12-16 14:10:39 UTC
Attachment 314383 [details] pushed as 4cda92b - glib-compile-resources: do not leak c_name