]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh-domain: fix memory leak in cmdDomDisplay
authorPavel Hrdina <phrdina@redhat.com>
Thu, 9 Jun 2016 07:05:35 +0000 (09:05 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 9 Jun 2016 07:14:32 +0000 (09:14 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
tools/virsh-domain.c

index 6f8edbb5d1535ad7138d335282e7a837873c2559..11116a90ad733d0bbc6285aef0123660b6c9d40e 100644 (file)
@@ -10637,8 +10637,10 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
                  * fails, if there is no listen_addr we will print "localhost". */
                 VIR_FREE(listen_addr);
 
-                if (uri && VIR_STRDUP(listen_addr, uri->server) < 0)
-                    goto cleanup;
+                if (uri) {
+                    listen_addr = vshStrdup(ctl, uri->server);
+                    virURIFree(uri);
+                }
             }
         }