]> Git Repo - qemu.git/commitdiff
block: Fix memory leak in hmp_drive_add_node()
authorKevin Wolf <[email protected]>
Wed, 16 Mar 2016 10:14:31 +0000 (11:14 +0100)
committerKevin Wolf <[email protected]>
Thu, 17 Mar 2016 14:47:56 +0000 (15:47 +0100)
hmp_drive_add_node() leaked qdict in the error path when no node-name is
specified.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
blockdev.c

index e7b8676495bd1b959c6af2b686ade73fb1a456be..50410bf328e4ddb0526af9ce0b52d0cf70271363 100644 (file)
@@ -3898,6 +3898,7 @@ void hmp_drive_add_node(Monitor *mon, const char *optstr)
     qdict = qemu_opts_to_qdict(opts, NULL);
 
     if (!qdict_get_try_str(qdict, "node-name")) {
+        QDECREF(qdict);
         error_report("'node-name' needs to be specified");
         goto out;
     }
This page took 0.031503 seconds and 4 git commands to generate.