]> git.ipfire.org Git - thirdparty/libvirt.git/commit
domain_conf: fix possible memory leak
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 19 Jun 2012 10:08:49 +0000 (12:08 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 19 Jun 2012 16:20:03 +0000 (18:20 +0200)
commit830d035ff5a88c3896a6e508364e34697de941a1
tree3ec2b721d4ad02261f9b5f2fc25a4d5633908070
parentfbc72a1d0bb7c0b67cac6f3d845d1ba4eb71fd9c
domain_conf: fix possible memory leak

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).
src/conf/domain_conf.c
src/conf/domain_conf.h