From 8a9a9999583a596ae4510c2b42b395ed7f860698 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 18 Feb 2015 13:11:34 +0100 Subject: [PATCH] dhcp-client: memleak: free hostname on dispose ==7745== 11 (+11) bytes in 1 (+1) blocks are definitely lost in loss record 408 of 5,735 ==7745== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==7745== by 0x7F4A6F5: g_malloc (gmem.c:97) ==7745== by 0x7F6301E: g_strdup (gstrfuncs.c:356) ==7745== by 0x45C188: nm_dhcp_client_start_ip4 (nm-dhcp-client.c:417) ==7745== by 0x460147: client_start (nm-dhcp-manager.c:268) ==7745== by 0x460393: nm_dhcp_manager_start_ip4 (nm-dhcp-manager.c:308) ==7745== by 0x44EB16: dhcp4_start (nm-device.c:3168) ==7745== by 0x44EE15: act_stage3_ip4_config_start (nm-device.c:3440) ==7745== by 0x455C9F: nm_device_activate_stage3_ip4_start (nm-device.c:4657) ==7745== by 0x456467: nm_device_activate_stage3_ip_config_start (nm-device.c:4801) ==7745== by 0x7F44AEA: g_main_dispatch (gmain.c:3111) ==7745== by 0x7F44AEA: g_main_context_dispatch (gmain.c:3710) ==7745== by 0x7F44E87: g_main_context_iterate.isra.29 (gmain.c:3781) (cherry picked from commit 76430f9ccad641d162c0ec79133bac56c55fe755) --- src/dhcp-manager/nm-dhcp-client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 951674953a..d8c77878fc 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -884,6 +884,7 @@ dispose (GObject *object) timeout_cleanup (self); g_clear_pointer (&priv->iface, g_free); + g_clear_pointer (&priv->hostname, g_free); if (priv->hwaddr) { g_byte_array_free (priv->hwaddr, TRUE);