[virt-tools-list] [PATCH virt-viewer 1/2] VirtViewer: Fix memory leaks

Jonathon Jongsma jjongsma at redhat.com
Wed Sep 10 18:42:13 UTC 2014


Don't leak priv->uri or priv->domkey from VirtViewer class
---
 src/virt-viewer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index c03503e..55780af 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -518,6 +518,14 @@ virt_viewer_dispose (GObject *object)
         virDomainFree(priv->dom);
     if (priv->conn)
         virConnectClose(priv->conn);
+    if (priv->uri) {
+        g_free(priv->uri);
+        priv->uri = NULL;
+    }
+    if (priv->domkey) {
+        g_free(priv->domkey);
+        priv->domkey = NULL;
+    }
     G_OBJECT_CLASS(virt_viewer_parent_class)->dispose (object);
 }
 
-- 
1.9.3




More information about the virt-tools-list mailing list