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

[libvirt] [PATCH 3/6] remote: Resolve Coverity RESOURCE_LEAK



Need to free 'uri_out' on error path.

Signed-off-by: Wang Rui <moon wangrui huawei com>
---
 daemon/remote.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 89714ca..0ea2815 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -2305,8 +2305,10 @@ remoteDispatchDomainMigratePrepare2(virNetServerPtr server ATTRIBUTE_UNUSED,
     rv = 0;
 
  cleanup:
-    if (rv < 0)
+    if (rv < 0) {
         virNetMessageSaveError(rerr);
+        VIR_FREE(uri_out);
+    }
     return rv;
 }
 
-- 
1.7.12.4



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