[PATCH] virsh-domain: fix memory leak in cmdDomDisplay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 tools/virsh-domain.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 6f8edbb..11116a9 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -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);
+                }
             }
         }
 
-- 
2.8.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]