]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Fix memory leak in qemuMonitorJSONNBDServerStart()
authorw00251574 <wangjie88@huawei.com>
Mon, 25 Jun 2018 13:48:50 +0000 (21:48 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 25 Jun 2018 17:41:40 +0000 (19:41 +0200)
Exiting early through the return path did result in 'port_str'
being leaked.

Signed-off-by: Jie Wang <wangjie88.huawei.com>
src/qemu/qemu_monitor_json.c

index aa89ea7056928988d2785a0e189cc66fba4294d9..3e90279b716468cc1cb8bc34552c123a576d2aa0 100644 (file)
@@ -6540,7 +6540,7 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
         return ret;
 
     if (!(addr = qemuMonitorJSONBuildInetSocketAddress(host, port_str)))
-        return ret;
+        goto cleanup;
 
     if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-start",
                                            "a:addr", &addr,