[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-upstream-unstable] qom: Fix memory leak in object_property_set_link()



commit 991a5f378261b759b2af2354703c504906418d35
Author:     Vlad Yasevich <vyasevic@xxxxxxxxxx>
AuthorDate: Fri Nov 15 12:09:47 2013 -0500
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Mon Dec 9 11:40:30 2013 -0600

    qom: Fix memory leak in object_property_set_link()
    
    Save the result of the call to object_get_canonical_path()
    so we can free it.
    
    Cc: qemu-stable@xxxxxxxxxx
    Signed-off-by: Vlad Yasevich <vyasevic@xxxxxxxxxx>
    Reviewed-by: Amos Kong <akong@xxxxxxxxxx>
    Reviewed-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
    Signed-off-by: Andreas Färber <afaerber@xxxxxxx>
    (cherry picked from commit 2d3aa28cc2cf382aa04cd577e0be542175eea9bd)
    
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 qom/object.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index b2479d1..333f807 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -823,8 +823,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,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.