From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViQT7-0003Qs-6z for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:10:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViQT1-0003MD-80 for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:10:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViQT0-0003M1-WA for qemu-devel@nongnu.org; Mon, 18 Nov 2013 10:10:23 -0500 From: Stefan Hajnoczi Date: Mon, 18 Nov 2013 16:10:11 +0100 Message-Id: <1384787411-7187-1-git-send-email-stefanha@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: Vlad Yasevich , akong@redhat.com, Stefan Hajnoczi , Andreas Faerber , Anthony Liguori object_get_canonical_path() returns a string that the caller is responsible for freeing. Signed-off-by: Stefan Hajnoczi --- qom/object.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 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_canonical_path(value); + object_property_set_str(obj, path, name, errp); + g_free(path); } Object *object_property_get_link(Object *obj, const char *name, -- 1.8.4.2