mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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:
parent
9f5b4b1f62
commit
39d963d1c0
@ -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;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user