virsh-domain: fix memory leak in cmdDomDisplay

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-06-09 09:05:35 +02:00
parent 378ef3df57
commit b1f6792cb6

View 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);
}
}
}