thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
0a122b
From 709b3788e91957a9cff1adbe8ceac45daa2fa2bd Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <709b3788e91957a9cff1adbe8ceac45daa2fa2bd.1387276076.git.minovotn@redhat.com>
0a122b
In-Reply-To: <e610718166120379517e80d1a7aa12d60294209b.1387276076.git.minovotn@redhat.com>
0a122b
References: <e610718166120379517e80d1a7aa12d60294209b.1387276076.git.minovotn@redhat.com>
0a122b
From: Amos Kong <akong@redhat.com>
0a122b
Date: Sat, 23 Nov 2013 03:17:44 +0100
0a122b
Subject: [PATCH 04/16] qom: Fix memory leak in object_property_set_link()
0a122b
MIME-Version: 1.0
0a122b
Content-Type: text/plain; charset=UTF-8
0a122b
Content-Transfer-Encoding: 8bit
0a122b
0a122b
RH-Author: Amos Kong <akong@redhat.com>
0a122b
Message-id: <1385176664-3852-3-git-send-email-akong@redhat.com>
0a122b
Patchwork-id: 55867
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 2/2] qom: Fix memory leak in object_property_set_link()
0a122b
Bugzilla: 1033810
0a122b
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
0a122b
0a122b
From: Vlad Yasevich <vyasevic@redhat.com>
0a122b
0a122b
Save the result of the call to object_get_canonical_path()
0a122b
so we can free it.
0a122b
0a122b
Cc: qemu-stable@nongnu.org
0a122b
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
0a122b
Reviewed-by: Amos Kong <akong@redhat.com>
0a122b
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
Signed-off-by: Andreas Färber <afaerber@suse.de>
0a122b
(cherry picked from commit 2d3aa28cc2cf382aa04cd577e0be542175eea9bd)
0a122b
---
0a122b
 qom/object.c |    5 +++--
0a122b
 1 files changed, 3 insertions(+), 2 deletions(-)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 qom/object.c | 5 +++--
0a122b
 1 file changed, 3 insertions(+), 2 deletions(-)
0a122b
0a122b
diff --git a/qom/object.c b/qom/object.c
0a122b
index b7ecb9f..05e2636 100644
0a122b
--- a/qom/object.c
0a122b
+++ b/qom/object.c
0a122b
@@ -824,8 +824,9 @@ char *object_property_get_str(Object *obj, const char *name,
0a122b
 void object_property_set_link(Object *obj, Object *value,
0a122b
                               const char *name, Error **errp)
0a122b
 {
0a122b
-    object_property_set_str(obj, object_get_canonical_path(value),
0a122b
-                            name, errp);
0a122b
+    gchar *path = object_get_canonical_path(value);
0a122b
+    object_property_set_str(obj, path, name, errp);
0a122b
+    g_free(path);
0a122b
 }
0a122b
 
0a122b
 Object *object_property_get_link(Object *obj, const char *name,
0a122b
-- 
0a122b
1.7.11.7
0a122b