From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwl1U-0000ll-4q for qemu-devel@nongnu.org; Fri, 05 Dec 2014 00:01:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xwl1P-00018F-A0 for qemu-devel@nongnu.org; Fri, 05 Dec 2014 00:01:44 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:11039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwl1O-00017B-P0 for qemu-devel@nongnu.org; Fri, 05 Dec 2014 00:01:39 -0500 Message-ID: <54813C1A.4060307@huawei.com> Date: Fri, 5 Dec 2014 13:01:14 +0800 From: Gonglei MIME-Version: 1.0 References: <1417750270-14056-1-git-send-email-arei.gonglei@huawei.com> <54813BA4.5040404@redhat.com> In-Reply-To: <54813BA4.5040404@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] spice: fix memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "pbonzini@redhat.com" , "Huangweidong (C)" , "qemu-devel@nongnu.org" , "kraxel@redhat.com" On 2014/12/5 12:59, Eric Blake wrote: > On 12/04/2014 08:31 PM, arei.gonglei@huawei.com wrote: >> From: Gonglei >> >> If errors happen for middle items of channel_list, >> qmp_query_spice_channels() return NULL, and varriable > > s/return/returns/ > s/varriable/the variable/ > >> cur_item going out of scope leaks the storage it points to. >> Let's check for errors in advance avoid memory leak. > > s/avoid/to avoid a/ > >> >> Suggested-by: Paolo Bonzini >> Signed-off-by: Gonglei >> --- >> ui/spice-core.c | 12 +++++++----- >> 1 file changed, 7 insertions(+), 5 deletions(-) >> > > Maintainer can fix up commit message typos. > Reviewed-by: Eric Blake > Thanks, Eric :) Regards, -Gonglei