virbitmaptest: Shut coverity up in case of broken test

Coverity reported a memleak in the test added in 7efd5fd1b0. 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.
This commit is contained in:
Peter Krempa 2013-08-19 14:02:52 +02:00
parent 9f5b4b1f62
commit 39d963d1c0

View File

@ -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;
}