[libvirt] [PATCH 6/6] virbitmaptest: Resolve Coverity errors

Peter Krempa pkrempa at redhat.com
Wed Jan 23 13:10:47 UTC 2013


On 01/22/13 23:09, John Ferlan wrote:
> test1: Need to check for bitmap before using as well as free it properly
> test2: need to check for bitsString2 before using it.
> ---
>   tests/virbitmaptest.c | 24 ++++++++++++++++--------
>   1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
> index db76672..66ffd1b 100644
> --- a/tests/virbitmaptest.c
> +++ b/tests/virbitmaptest.c
> @@ -29,26 +29,33 @@ static int test1(const void *data ATTRIBUTE_UNUSED)

[...]

>
> -    return 0;
> +    ret = 0;
> +
> +error:

Hm, this label would be probably better to be named "cleanup" as the 
success path takes it too, but that's a small nit.

> +    virBitmapFree(bitmap);
> +    return ret;
>   }
>
>   static int

ACK, and I will push the series soon.

Peter




More information about the libvir-list mailing list