[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/14] qom: fix leak for objects created with -object
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 04/14] qom: fix leak for objects created with -object |
Date: |
Mon, 6 Jan 2014 17:03:05 -0500 |
From: Paolo Bonzini <address@hidden>
The object must be unref-ed when its variable goes out of scope.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Tested-by: Igor Mammedov <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
vl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vl.c b/vl.c
index 0f67545..2170a5e 100644
--- a/vl.c
+++ b/vl.c
@@ -2810,12 +2810,13 @@ static int object_create(QemuOpts *opts, void *opaque)
obj = object_new(type);
if (qemu_opt_foreach(opts, object_set_property, obj, 1) < 0) {
+ object_unref(obj);
return -1;
}
object_property_add_child(container_get(object_get_root(), "/objects"),
id, obj, NULL);
-
+ object_unref(obj);
return 0;
}
--
1.8.1.4
- [Qemu-devel] [PULL 00/14] QMP queue, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 01/14] vl: add missing transition debug->finish_migrate, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 02/14] qemu-monitor: HMP cpu-add wrapper, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 03/14] rng: initialize file descriptor to -1, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 08/14] error: Add error_abort, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 05/14] qom: catch errors in object_property_add_child, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 09/14] qdev: Delete dead code, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 06/14] monitor: add object-del (QMP) and object_del (HMP) command, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 04/14] qom: fix leak for objects created with -object,
Luiz Capitulino <=
- [Qemu-devel] [PULL 12/14] qemu-option: Remove qemu_opts_create_nofail, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 10/14] hw: Remove assert_no_error usages, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 11/14] target-i386: Remove assert_no_error usage, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 07/14] monitor: add object-add (QMP) and object_add (HMP) command, Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 13/14] qerror: Remove assert_no_error(), Luiz Capitulino, 2014/01/06
- [Qemu-devel] [PULL 14/14] migration: qmp_migrate(): keep working after syntax error, Luiz Capitulino, 2014/01/06
- Re: [Qemu-devel] [PULL 00/14] QMP queue, Peter Maydell, 2014/01/06
- Re: [Qemu-devel] [PULL 00/14] QMP queue, Peter Crosthwaite, 2014/01/13