[libvirt] [PATCH 2/n] maint: prohibit most uses of xmlGetProp

Matthias Bolte matthias.bolte at googlemail.com
Wed Nov 24 21:27:12 UTC 2010


2010/11/24 Eric Blake <eblake at redhat.com>:
> Making this change makes it easier to spot the memory leaks
> that will be fixed in the next patch.
>
> * cfg.mk (sc_prohibit_xmlGetProp): New rule.
> * .x-sc_prohibit_xmlGetProp: New exception.
> * Makefile.am (EXTRA_DIST): Ship exception file.
> * tools/virsh.c (cmdDetachInterface, cmdDetachDisk): Adjust
> offenders.
> * src/conf/storage_conf.c (virStoragePoolDefParseSource):
> Likewise.
> * src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML)
> (virNetworkIPParseXML): Likewise.
> ---
>
> valgrind picked up a memory leak in virNetworkDHCPRangeDefParseXML,
> but our use of non-idiomatic string management made it harder to
> see at first glance.  This makes the few outliers consistent with
> all the rest of the code base.
>

ACK.

Matthias




More information about the libvir-list mailing list