[libvirt] [PATCH 1/3] virDomainDefParseXML: Free @tmp when parsing genid
Peter Krempa
pkrempa at redhat.com
Wed May 30 16:46:38 UTC 2018
On Wed, May 30, 2018 at 18:04:27 +0200, Michal Privoznik wrote:
> We need to free return value of virXPathString().
>
> ==12962== 37 bytes in 1 blocks are definitely lost in loss record 156 of 331
> ==12962== at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
> ==12962== by 0x91E8439: strdup (in /lib64/libc-2.25.so)
> ==12962== by 0x5DBD551: virStrdup (virstring.c:977)
> ==12962== by 0x5DD3E5E: virXPathString (virxml.c:84)
> ==12962== by 0x5E178AB: virDomainDefParseXML (domain_conf.c:19110)
> ==12962== by 0x5E1E985: virDomainDefParseNode (domain_conf.c:20885)
> ==12962== by 0x5E1E7CB: virDomainDefParse (domain_conf.c:20827)
> ==12962== by 0x5E1E871: virDomainDefParseFile (domain_conf.c:20853)
>
> Signed-off-by: Michal Privoznik <mprivozn 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 27e2bd50eb..d8b4fbd6b0 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -19120,6 +19120,7 @@ virDomainDefParseXML(xmlDocPtr xml,
> "%s", _("malformed genid element"));
> goto error;
> }
> + VIR_FREE(tmp);
ACK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180530/bebc9ce5/attachment-0001.sig>
More information about the libvir-list
mailing list