[libvirt] [PATCH 1/6] conf: Resolve Coverity RESOURCE_LEAK

Peter Krempa pkrempa at redhat.com
Wed Mar 11 06:32:34 UTC 2015


On Tue, Mar 10, 2015 at 19:20:24 -0400, John Ferlan wrote:
> Commit id 'c9027d8f' added parsing of the CapNet for offload SRIOV NIC
> discovery, but forgot to free the nodes
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/node_device_conf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
> index f9c9b6f..d309bc6 100644
> --- a/src/conf/node_device_conf.c
> +++ b/src/conf/node_device_conf.c
> @@ -1002,6 +1002,7 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt,
>      ret = 0;

The same patch also added code that uses the @tmp variable to extract a
string via virXMLPropString and it is not freed either.

>   out:
>      ctxt->node = orignode;
> +    VIR_FREE(nodes);
>      return ret;
>  }
>  

ACK with both leaks fixed.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150311/356d98ba/attachment-0001.sig>


More information about the libvir-list mailing list