From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViQUW-0005En-B2 for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:12:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViQUO-0003eM-Gw for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:11:56 -0500 Received: from cantor2.suse.de ([195.135.220.15]:33357 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViQUO-0003e8-8o for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:11:48 -0500 Message-ID: <528A2E2F.2010001@suse.de> Date: Mon, 18 Nov 2013 16:11:43 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1384787411-7187-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1384787411-7187-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 for-1.7] qom: fix object_property_set_link() memory leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Vlad Yasevich , akong@redhat.com, Anthony Liguori Am 18.11.2013 16:10, schrieb Stefan Hajnoczi: > object_get_canonical_path() returns a string that the caller is > responsible for freeing. >=20 > Signed-off-by: Stefan Hajnoczi What's the difference to Vlad's v2? Andreas > --- > qom/object.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/qom/object.c b/qom/object.c > index b617f26..fc19cf6 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -838,8 +838,9 @@ char *object_property_get_str(Object *obj, const ch= ar *name, > void object_property_set_link(Object *obj, Object *value, > const char *name, Error **errp) > { > - object_property_set_str(obj, object_get_canonical_path(value), > - name, errp); > + gchar *path =3D object_get_canonical_path(value); > + object_property_set_str(obj, path, name, errp); > + g_free(path); > } > =20 > Object *object_property_get_link(Object *obj, const char *name, >=20 --=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