From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxufP-00088f-Gd for qemu-devel@nongnu.org; Mon, 08 Dec 2014 04:31:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxufI-0000kc-Vl for qemu-devel@nongnu.org; Mon, 08 Dec 2014 04:31:43 -0500 Received: from mail-r83.rz.uni-mannheim.de ([134.155.96.83]:42185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxufI-0000kR-PL for qemu-devel@nongnu.org; Mon, 08 Dec 2014 04:31:36 -0500 Message-ID: <54856FF7.2000600@weilnetz.de> Date: Mon, 08 Dec 2014 10:31:35 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1417768210-9688-1-git-send-email-arei.gonglei@huawei.com> <1418030754.27021.23.camel@nilsson.home.kraxel.org> In-Reply-To: <1418030754.27021.23.camel@nilsson.home.kraxel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] spice: fix memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , arei.gonglei@huawei.com Cc: pbonzini@redhat.com, weidong.huang@huawei.com, qemu-devel@nongnu.org Am 08.12.2014 um 10:25 schrieb Gerd Hoffmann: > On Fr, 2014-12-05 at 16:30 +0800, arei.gonglei@huawei.com wrote: >> From: Gonglei >> >> If errors happen for middle items of channel_list, >> qmp_query_spice_channels() returns NULL, and the variable >> cur_item going out of scope leaks the storage it points to. >> >> The flag is a compatibility thing for older spice-server >> versions. Meanwhile our minimum spice version requirement is >> new enough that we should never ever see this error, and if we >> do something went very seriously wrong. Let's using assert() >> instead of returning NULL to avoid a memory leak. >> >> Suggested-by: Paolo Bonzini >> Signed-off-by: Gonglei >> Reviewed-by: Eric Blake > Added to spice patch queue. > > thanks > Gerd Shouldn't we use g_assert instead of assert? Maybe you can fix this without a new patch iteration. Stefan