提交 39d963d1 编写于 作者: P Peter Krempa

virbitmaptest: Shut coverity up in case of broken test

Coverity reported a memleak in the test added in 7efd5fd1. 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.
上级 9f5b4b1f
...@@ -470,7 +470,7 @@ static int ...@@ -470,7 +470,7 @@ static int
test9(const void *opaque ATTRIBUTE_UNUSED) test9(const void *opaque ATTRIBUTE_UNUSED)
{ {
int ret = -1; int ret = -1;
virBitmapPtr bitmap; virBitmapPtr bitmap = NULL;
if (virBitmapParse("100000000", 0, &bitmap, 20) != -1) if (virBitmapParse("100000000", 0, &bitmap, 20) != -1)
goto cleanup; goto cleanup;
...@@ -492,6 +492,7 @@ test9(const void *opaque ATTRIBUTE_UNUSED) ...@@ -492,6 +492,7 @@ test9(const void *opaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virBitmapFree(bitmap);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册