[libvirt] [PATCH] conf: fix a memory leak when parsing nat port XML nodes

Laine Stump laine at laine.org
Wed Apr 10 16:05:24 UTC 2013


On 04/10/2013 05:51 AM, Guannan Ren wrote:
>  ==5306== 8 bytes in 1 blocks are definitely lost in loss record 24 of 277
>  ==5306==    at 0x4C28B2F: calloc (vg_replace_malloc.c:593)
>  ==5306==    by 0x5293CAF: virAllocN (viralloc.c:152)
>  ==5306==    by 0x52DFEAE: virXPathNodeSet (virxml.c:611)
>  ==5306==    by 0x5313DD9: virNetworkDefParseXML (network_conf.c:1408)
>  ==5306==    by 0x53170F6: virNetworkObjUpdateParseFile (network_conf.c:2031)
>  ==5306==    by 0x131DA63C: networkStartup (bridge_driver.c:279)
>  ==5306==    by 0x53481DF: virStateInitialize (libvirt.c:822)
>  ==5306==    by 0x40DF44: daemonRunStateInit (libvirtd.c:877)
>  ==5306==    by 0x52D2FF5: virThreadHelper (virthreadpthread.c:161)
>  ==5306==    by 0x5D00C52: start_thread (in /usr/lib64/libpthread-2.17.so)
>  ==5306==    by 0x6410ECC: clone (in /usr/lib64/libc-2.17.so)
>
> ---
>  src/conf/network_conf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
> index c5535e6..968cf11 100644
> --- a/src/conf/network_conf.c
> +++ b/src/conf/network_conf.c
> @@ -1440,6 +1440,7 @@ cleanup:
>      VIR_FREE(addrStart);
>      VIR_FREE(addrEnd);
>      VIR_FREE(natAddrNodes);
> +    VIR_FREE(natPortNodes);
>      ctxt->node = save;
>      return ret;
>  }

ACK.




More information about the libvir-list mailing list