From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YK1JC-0007t8-HX for mharc-qemu-trivial@gnu.org; Sat, 07 Feb 2015 04:04:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YK1JA-0007pB-4p for qemu-trivial@nongnu.org; Sat, 07 Feb 2015 04:04:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YK1J9-00066Y-Ec for qemu-trivial@nongnu.org; Sat, 07 Feb 2015 04:04:08 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:52014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YK1J0-00064i-W0; Sat, 07 Feb 2015 04:03:59 -0500 Received: from [192.168.88.2] (mjt.vpn.tls.msk.ru [192.168.177.99]) by isrv.corpit.ru (Postfix) with ESMTP id 5CF5B41366; Sat, 7 Feb 2015 12:03:58 +0300 (MSK) Message-ID: <54D5D4FE.8070508@msgid.tls.msk.ru> Date: Sat, 07 Feb 2015 12:03:58 +0300 From: Michael Tokarev Organization: Telecom Service, JSC User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: Paolo Bonzini , Christian Borntraeger , qemu-devel References: <1422457637-45862-1-git-send-email-borntraeger@de.ibm.com> <54C8FDDF.6010300@redhat.com> In-Reply-To: <54C8FDDF.6010300@redhat.com> OpenPGP: id=804465C5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: "qemu-trivial@nongnu.org" , Peter Maydell , Marcel Apfelbaum Subject: Re: [Qemu-trivial] [PATCH/RFC] vl.c: fix memory leak spotted by valgrind X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2015 09:04:08 -0000 28.01.2015 18:18, Paolo Bonzini wrote: > Reviewed-by: Paolo Bonzini Applied to -trivial, thank you! /mjt > On 28/01/2015 16:07, Christian Borntraeger wrote: >> valgrind complains about: >> ==42062== 16 bytes in 1 blocks are definitely lost in loss record 387 of 1,048 >> ==42062== at 0x402DCB2: malloc (vg_replace_malloc.c:299) >> ==42062== by 0x40C1BE3: g_malloc (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x40DA133: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x40DB2E5: g_slist_prepend (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x801637FF: object_class_get_list_tramp (object.c:690) >> ==42062== by 0x40A96C9: g_hash_table_foreach (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x80164885: object_class_foreach (object.c:665) >> ==42062== by 0x80164975: object_class_get_list (object.c:698) >> ==42062== by 0x800100A5: machine_parse (vl.c:2447) >> ==42062== by 0x800100A5: main (vl.c:3756) >> >> Lets free machines in case of mc. >> >> Signed-off-by: Christian Borntraeger >> --- >> vl.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/vl.c b/vl.c >> index 983259b..9d008ac 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -2450,6 +2450,7 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b) >> mc = find_machine(name); >> } >> if (mc) { >> + g_slist_free(machines); >> return mc; >> } >> if (name && !is_help_option(name)) { >> > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YK1J8-0007p3-L6 for qemu-devel@nongnu.org; Sat, 07 Feb 2015 04:04:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YK1J1-00064n-7S for qemu-devel@nongnu.org; Sat, 07 Feb 2015 04:04:06 -0500 Message-ID: <54D5D4FE.8070508@msgid.tls.msk.ru> Date: Sat, 07 Feb 2015 12:03:58 +0300 From: Michael Tokarev MIME-Version: 1.0 References: <1422457637-45862-1-git-send-email-borntraeger@de.ibm.com> <54C8FDDF.6010300@redhat.com> In-Reply-To: <54C8FDDF.6010300@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH/RFC] vl.c: fix memory leak spotted by valgrind List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Christian Borntraeger , qemu-devel Cc: "qemu-trivial@nongnu.org" , Peter Maydell , Marcel Apfelbaum 28.01.2015 18:18, Paolo Bonzini wrote: > Reviewed-by: Paolo Bonzini Applied to -trivial, thank you! /mjt > On 28/01/2015 16:07, Christian Borntraeger wrote: >> valgrind complains about: >> ==42062== 16 bytes in 1 blocks are definitely lost in loss record 387 of 1,048 >> ==42062== at 0x402DCB2: malloc (vg_replace_malloc.c:299) >> ==42062== by 0x40C1BE3: g_malloc (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x40DA133: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x40DB2E5: g_slist_prepend (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x801637FF: object_class_get_list_tramp (object.c:690) >> ==42062== by 0x40A96C9: g_hash_table_foreach (in /usr/lib64/libglib-2.0.so.0.3800.2) >> ==42062== by 0x80164885: object_class_foreach (object.c:665) >> ==42062== by 0x80164975: object_class_get_list (object.c:698) >> ==42062== by 0x800100A5: machine_parse (vl.c:2447) >> ==42062== by 0x800100A5: main (vl.c:3756) >> >> Lets free machines in case of mc. >> >> Signed-off-by: Christian Borntraeger >> --- >> vl.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/vl.c b/vl.c >> index 983259b..9d008ac 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -2450,6 +2450,7 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b) >> mc = find_machine(name); >> } >> if (mc) { >> + g_slist_free(machines); >> return mc; >> } >> if (name && !is_help_option(name)) { >> >