[libvirt] [PATCH 2/6] tests: Resolve Coverity RESOURCE_LEAK

John Ferlan jferlan at redhat.com
Wed Sep 23 23:18:29 UTC 2015


In the error path need to unref the 'caps' as well

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 tests/qemucaps2xmltest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
index 6a5811c..7adde24 100644
--- a/tests/qemucaps2xmltest.c
+++ b/tests/qemucaps2xmltest.c
@@ -113,6 +113,7 @@ testGetCaps(char *capsData, const testQemuData *data)
 
  error:
     virObjectUnref(qemuCaps);
+    virObjectUnref(caps);
     return NULL;
 }
 
-- 
2.1.0




More information about the libvir-list mailing list