[libvirt] [PATCH 3/3] qemumonitortestutils: Don't skip va_end() on error path

Eric Blake eblake at redhat.com
Thu Aug 1 17:55:17 UTC 2013


On 08/01/2013 08:39 AM, Peter Krempa wrote:
> When allocation of memory failed the error path didn't call va_end()
> causing a coverity failure.
> 
> Reported by John Ferlan.
> ---
>  tests/qemumonitortestutils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK.

> 
> diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
> index fb76156..5697946 100644
> --- a/tests/qemumonitortestutils.c
> +++ b/tests/qemumonitortestutils.c
> @@ -669,7 +669,7 @@ qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
>      va_start(args, response);
> 
>      if (VIR_ALLOC(data) < 0)
> -        return -1;
> +        goto error;
> 
>      if (VIR_STRDUP(data->command_name, cmdname) < 0 ||
>          VIR_STRDUP(data->response, response) < 0)
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130801/f911377d/attachment-0001.sig>


More information about the libvir-list mailing list