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