Re: [PATCH] Properly free the xmlDocPtr when loading pool state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 29, 2015 at 15:11:35 +0200, Ján Tomko wrote:
> Use xmlFreeDoc instead of plain xmlFree.
> 
> 4 bytes in 1 blocks are definitely lost in loss record 9 of 1,084
>     at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>     by 0x70730D6: xmlStrndup (in /usr/lib64/libxml2.so.2.9.2)
>     by 0x701E3DC: xmlNewDoc (in /usr/lib64/libxml2.so.2.9.2)
>     by 0x70C39F8: xmlSAX2StartDocument (in /usr/lib64/libxml2.so.2.9.2)
>     by 0x7017245: xmlParseDocument (in /usr/lib64/libxml2.so.2.9.2)
>     by 0x7017606: xmlDoRead (in /usr/lib64/libxml2.so.2.9.2)
>     by 0x5309DAD: virXMLParseHelper (virxml.c:742)
>     by 0x5367584: virStoragePoolLoadState (storage_conf.c:1863)
> ---
>  src/conf/storage_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
> index 7857a5e..df536d4 100644
> --- a/src/conf/storage_conf.c
> +++ b/src/conf/storage_conf.c
> @@ -1894,7 +1894,7 @@ virStoragePoolLoadState(virStoragePoolObjListPtr pools,
>  
>   cleanup:
>      VIR_FREE(stateFile);
> -    xmlFree(xml);
> +    xmlFreeDoc(xml);
>      xmlXPathFreeContext(ctxt);
>      return pool;

ACK, safe for freeze.

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]