From: Peter Krempa Date: Mon, 19 Aug 2013 12:02:52 +0000 (+0200) Subject: virbitmaptest: Shut coverity up in case of broken test X-Git-Tag: v1.1.2-rc1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39d963d1c0090fab56ac4998f81ec7aabd0cfe00;p=thirdparty%2Flibvirt.git virbitmaptest: Shut coverity up in case of broken test 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. --- diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index c56d6fa284..7ec78fdad4 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -470,7 +470,7 @@ static int test9(const void *opaque ATTRIBUTE_UNUSED) { int ret = -1; - virBitmapPtr bitmap; + virBitmapPtr bitmap = NULL; if (virBitmapParse("100000000", 0, &bitmap, 20) != -1) goto cleanup; @@ -492,6 +492,7 @@ test9(const void *opaque ATTRIBUTE_UNUSED) ret = 0; cleanup: + virBitmapFree(bitmap); return ret; }