Skip to contentSkip to conversation

qapi: fix memory leak in bdrv_image_info_specific_dump

PATCH Superseded Pino Toscano 2 participants 3 messages Oct 18, 2016 Block layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qapi: fix memory leak in bdrv_image_info_specific_dump

The 'obj' result of the visitor was not properly freed, like done in other places doing a similar job.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
block/qapi.c +1 -0
index 6f947e3..50d3090 100644
@@ -698,6 +698,7 @@ void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f,
     assert(qobject_type(obj) == QTYPE_QDICT);
     data = qdict_get(qobject_to_qdict(obj), "data");
     dump_qobject(func_fprintf, f, 1, data);
+    qobject_decref(obj);
     visit_free(v);
 }
 
Signature · 1 line
2.7.4
#1 lore raw

Am 18.10.2016 um 11:18 hat Pino Toscano geschrieben:

Quoted 11 lines

The 'obj' result of the visitor was not properly freed, like done in other places doing a similar job.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
block/qapi.c +0 -0
index 6f947e3..50d3090 100644

block/qapi.c void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f, · line 703

Quoted 6 lines
block/qapi.c +1 -0
@@ -698,6 +698,7 @@ void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f,
     assert(qobject_type(obj) == QTYPE_QDICT);
     data = qdict_get(qobject_to_qdict(obj), "data");
     dump_qobject(func_fprintf, f, 1, data);
+    qobject_decref(obj);
     visit_free(v);
 }

The change looks good, but without a Signed-off-by line I can't accept the patch: http://wiki.qemu.org/Contribute/SubmitAPatch

Kevin

#2 lore raw
Quoted 7 lines · On Tuesday, 18 October 2016 11:44:26 CEST Kevin Wolf wrote:

Am 18.10.2016 um 11:18 hat Pino Toscano geschrieben:

Quoted 6 lines

The 'obj' result of the visitor was not properly freed, like done in other places doing a similar job.

---
 block/qapi.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

block/qapi.c void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f, · line 703

Quoted 11 lines
block/qapi.c +1 -0
index 6f947e3..50d3090 100644
@@ -698,6 +698,7 @@ void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f,
     assert(qobject_type(obj) == QTYPE_QDICT);
     data = qdict_get(qobject_to_qdict(obj), "data");
     dump_qobject(func_fprintf, f, 1, data);
+    qobject_decref(obj);
     visit_free(v);
 }

The change looks good, but without a Signed-off-by line I can't accept the patch: http://wiki.qemu.org/Contribute/SubmitAPatch

D'oh, sorry -- apparently I didn't send the right version... v2 coming.

Thanks,

Signature · 1 line
Pino Toscano