From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKrvz-0003KA-KG for qemu-devel@nongnu.org; Tue, 04 Mar 2014 11:11:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKrvt-0007Dt-Pl for qemu-devel@nongnu.org; Tue, 04 Mar 2014 11:11:11 -0500 Message-ID: <5315FB16.3010905@suse.de> Date: Tue, 04 Mar 2014 17:11:02 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1393943298-5938-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1393943298-5938-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qom: avoid leaking str and bool properties on failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: qemu-stable Am 04.03.2014 15:28, schrieb Stefan Hajnoczi: > When object_property_add_str() and object_property_add_bool() fail, the= y > leak their internal StringProperty and BoolProperty structs. Remember > to free the structs on error. >=20 > Luckily this is a low-impact memory leak since most QOM properties are > static qdev properties that will never take the error case. > object_property_add() only fails if the property name is already in use= . >=20 > Signed-off-by: Stefan Hajnoczi > --- > qom/object.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) Nice catch! Thanks, applied to qom-next (and suggesting for qemu-stable): https://github.com/afaerber/qemu-cpu/commits/qom-next Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg