[libvirt] [PATCHv2 6/7] domain_conf: Resolve Coverity RESOURCE_LEAK

Laine Stump laine at laine.org
Thu Jan 15 18:47:22 UTC 2015


On 01/15/2015 04:25 AM, Cédric Bosdonnat wrote:
> From: John Ferlan <jferlan at redhat.com>
>
> Commit id 'aa2cc721' added call to virSocketAddrFormat
> and did not VIR_FREE() the returned memory.
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/domain_conf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 3c5f279..d262d72 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -17198,6 +17198,7 @@ virDomainNetIpsFormat(virBufferPtr buf, virDomainNetIpDefPtr *ips, size_t nips)
>              familyStr = "ipv4";
>          virBufferAsprintf(buf, "<ip address='%s'",
>                            ipStr);
> +        VIR_FREE(ipStr);
>          if (familyStr)
>              virBufferAsprintf(buf, " family='%s'", familyStr);
>          if (ips[i]->prefix != 0)

ACK.




More information about the libvir-list mailing list