From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMsj-00053s-84 for qemu-devel@nongnu.org; Fri, 15 Nov 2013 12:08:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhMsd-0006tl-8O for qemu-devel@nongnu.org; Fri, 15 Nov 2013 12:08:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhMsd-0006tQ-01 for qemu-devel@nongnu.org; Fri, 15 Nov 2013 12:08:27 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAFH8PbQ027449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Nov 2013 12:08:26 -0500 Message-ID: <52865508.9030905@redhat.com> Date: Fri, 15 Nov 2013 12:08:24 -0500 From: Vlad Yasevich MIME-Version: 1.0 References: <1384535216-6171-1-git-send-email-vyasevic@redhat.com> In-Reply-To: <1384535216-6171-1-git-send-email-vyasevic@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qom: Fix memory leak in object_property_set_link() Reply-To: vyasevic@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 11/15/2013 12:06 PM, Vlad Yasevich wrote: > Save the result of the call to object_get_cannonical_path() > so we can free it. > > Signed-off-by: Vlad Yasevich > --- > qom/object.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/qom/object.c b/qom/object.c > index b617f26..21b6f87 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -838,8 +838,9 @@ char *object_property_get_str(Object *obj, const char *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 = object_get_cannonical_path(value); > + object_property_set_str(obj, path, name, errp); > + gfree(path); > } > > Object *object_property_get_link(Object *obj, const char *name, > Self-nack. Forgot to commit the changes that actually make it build and work :/ -vlad