• M
    domain_conf: fix possible memory leak · 49cb53fa
    Martin Kletzander 提交于
    Until now, it was possible to crash libvirtd when defining domain with
    channel device with missing source element.
    
    When creating new virDomainChrDef, target.port is set to -1, but
    unfortunately it is an union with addresses that virDomainChrDefFree
    tries to free in case the deviceType is channel. Having the port set
    to -1 is intended, however the cleanest way to get around the problems
    with the crash seems to be renumbering the VIR_DOMAIN_CHR_CHANNEL_
    target types to cover new NONE type (with value 0) being the default
    (no target type yet).
    (cherry picked from commit 830d035f)
    49cb53fa
domain_conf.h 67.5 KB