• E
    build: prohibit raw malloc and free · a7cfd709
    Eric Blake 提交于
    Our HACKING discourages use of malloc and free, for at least
    a couple of years now.  But we weren't enforcing it, until now :)
    
    For now, I've exempted python and tests, and will clean those up
    in subsequent patches.  Examples should be permanently exempt,
    since anyone copying our examples won't have use of our
    internal-only memory.h via libvirt_util.la.
    
    * cfg.mk (sc_prohibit_raw_allocation): New rule.
    (exclude_file_name_regexp--sc_prohibit_raw_allocation): and
    exemptions.
    * src/cpu/cpu.c (cpuDataFree): Avoid false positive.
    * src/conf/network_conf.c (virNetworkDNSSrvDefParseXML): Fix
    offenders.
    * src/libxl/libxl_conf.c (libxlMakeDomBuildInfo, libxlMakeVfb)
    (libxlMakeDeviceModelInfo): Likewise.
    * src/rpc/virnetmessage.c (virNetMessageSaveError): Likewise.
    * tools/virsh.c (_vshMalloc, _vshCalloc): Likewise.
    a7cfd709
libxl_conf.c 29.7 KB