From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViR7S-0004Zf-Qh for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:52:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViR7N-0001IE-UU for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:52:10 -0500 Message-ID: <528A37A2.4020303@suse.de> Date: Mon, 18 Nov 2013 16:52:02 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1384535387-6290-1-git-send-email-vyasevic@redhat.com> In-Reply-To: <1384535387-6290-1-git-send-email-vyasevic@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 for-1.7] qom: Fix memory leak in object_property_set_link() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vlad Yasevich , qemu-devel@nongnu.org Cc: Amos Kong , Anthony Liguori , Stefan Hajnoczi , qemu-stable Am 15.11.2013 18:09, schrieb Vlad Yasevich: > Save the result of the call to object_get_cannonical_path() > so we can free it. >=20 > Signed-off-by: Vlad Yasevich Cc: qemu-stable@nongnu.org Reviewed-by: Andreas F=E4rber in case Anthony wants to pick it up himself, and queued on qom-next: https://github.com/afaerber/qemu-cpu/commits/qom-next It looks as if Stefan posted an identical patch with for-1.7 tag but with his From. Regards, Andreas > --- > v1->v2: Builds and works :) >=20 > 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