[PATCH] virbitmaptest: Shut coverity up in case of broken test

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

 



Coverity reported a memleak in the test added in 7efd5fd1b02. In case
the code will be broken and the code will actually parse a faulty bitmap
the resulting pointer would be leaked. Free it although that shouldn't
ever happen.
---
 tests/virbitmaptest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
index c56d6fa..e00b0a0 100644
--- a/tests/virbitmaptest.c
+++ b/tests/virbitmaptest.c
@@ -492,6 +492,7 @@ test9(const void *opaque ATTRIBUTE_UNUSED)

     ret = 0;
 cleanup:
+    virBitmapFree(bitmap);
     return ret;

 }
-- 
1.8.3.2

--
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]