[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/13] qom: fix leak for objects created with -object
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 09/13] qom: fix leak for objects created with -object |
Date: |
Wed, 18 Dec 2013 11:59:59 -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>
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 1f189d3..fcf2cc3 100644
--- a/vl.c
+++ b/vl.c
@@ -2811,12 +2811,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 11/13] monitor: add object-add (QMP) and object_add (HMP) command, (continued)
- [Qemu-devel] [PULL 11/13] monitor: add object-add (QMP) and object_add (HMP) command, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 12/13] monitor: add object-del (QMP) and object_del (HMP) command, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 13/13] qemu-monitor: HMP cpu-add wrapper, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 01/13] vl: add missing transition debug->finish_migrate, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 06/13] qemu-option: Remove qemu_opts_create_nofail, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 03/13] hw/core/qdev: Delete dead code, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 02/13] error: Add error_abort, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 04/13] hw: Remove assert_no_error usages, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 08/13] rng: initialize file descriptor to -1, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 09/13] qom: fix leak for objects created with -object,
Luiz Capitulino <=
- [Qemu-devel] [PULL 05/13] target-i386: Remove assert_no_error usage, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 07/13] qerror: Remove assert_no_error(), Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 10/13] qom: catch errors in object_property_add_child, Luiz Capitulino, 2013/12/18
- Re: [Qemu-devel] [PULL 00/13] QMP queue, Peter Maydell, 2013/12/19
- Re: [Qemu-devel] [PULL 00/13] QMP queue, Anthony Liguori, 2013/12/19