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 664510 - wizard: fix memleaks
wizard: fix memleaks
Status: RESOLVED FIXED
Product: gnome-bluetooth
Classification: Core
Component: wizard
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-bluetooth-general-maint@gnome.bugs
gnome-bluetooth-general-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2011-11-21 21:17 UTC by Daniele Forsi
Modified: 2011-11-25 10:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add g_free () where needed (942 bytes, patch)
2011-11-21 21:43 UTC, Daniele Forsi
committed Details | Review

Description Daniele Forsi 2011-11-21 21:17:44 UTC
target_pincode was overwritten by g_strdup() and text wasn't free after use.

Valgrind output:

==22389== 7 bytes in 1 blocks are definitely lost in loss record 368 of 10,352
==22389==    at 0x4028876: malloc (vg_replace_malloc.c:236)
==22389==    by 0x48F63BF: __vasprintf_chk (vasprintf_chk.c:82)
==22389==    by 0x4782B65: g_vasprintf (in /lib/i386-linux-gnu/libglib-2.0.so.0.3000.0)
==22389==    by 0x475BE52: g_strdup_vprintf (in /lib/i386-linux-gnu/libglib-2.0.so.0.3000.0)
==22389==    by 0x475BE82: g_strdup_printf (in /lib/i386-linux-gnu/libglib-2.0.so.0.3000.0)
==22389==    by 0x804B3B6: update_random_pincode (main.c:148)
==22389==    by 0x804BB97: restart_button_clicked (main.c:175)
==22389==    by 0x46B914B: g_cclosure_marshal_VOID__VOID (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3000.0)
==22389==    by 0x46B7C3B: g_closure_invoke (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3000.0)
==22389==    by 0x46CA9EF: ??? (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3000.0)
==22389==    by 0x46D3786: g_signal_emit_valist (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3000.0)
==22389==    by 0x46D38F2: g_signal_emit (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3000.0)

==22394== 38 bytes in 1 blocks are definitely lost in loss record 3,689 of 5,782
==22394==    at 0x4025BD3: malloc (vg_replace_malloc.c:236)
==22394==    by 0x4A9A49F: __vasprintf_chk (vasprintf_chk.c:82)
==22394==    by 0x496A9EE: g_vasprintf (in /lib/libglib-2.0.so.0.2600.1)
==22394==    by 0x4946B51: g_strdup_vprintf (in /lib/libglib-2.0.so.0.2600.1)
==22394==    by 0x4946B83: g_strdup_printf (in /lib/libglib-2.0.so.0.2600.1)
==22394==    by 0x804F472: create_callback (main.c:383)
==22394==    by 0x804FE79: create_device_callback (bluetooth-client.c:1651)
==22394==    by 0x407850E: ??? (in /usr/lib/libdbus-glib-1.so.2.1.0)
==22394==    by 0x40A9840: ??? (in /lib/libdbus-1.so.3.5.2)
==22394==    by 0x4097975: ??? (in /lib/libdbus-1.so.3.5.2)
==22394==    by 0x409AB81: dbus_connection_dispatch (in /lib/libdbus-1.so.3.5.2)
==22394==    by 0x407339C: ??? (in /usr/lib/libdbus-glib-1.so.2.1.0)
Comment 1 Daniele Forsi 2011-11-21 21:43:16 UTC
Created attachment 201878 [details] [review]
Add g_free () where needed
Comment 2 Bastien Nocera 2011-11-22 10:43:53 UTC
Review of attachment 201878 [details] [review]:

Looks good.