]> git.ipfire.org Git - thirdparty/libvirt.git/commit
domain_conf.c: avoid a leak and the need for "cleanup:" block
authorJim Meyering <meyering@redhat.com>
Wed, 20 Jan 2010 18:27:43 +0000 (19:27 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 20 Jan 2010 20:46:30 +0000 (21:46 +0100)
commit1825c6555a2e8c73b657c031072957297bc82840
treed8e746d22af164b1fb6628f59c5c406361ae946c
parent50b6c95d6275b304296f7ed80a7bbcb1c386e111
domain_conf.c: avoid a leak and the need for "cleanup:" block

* src/conf/domain_conf.c (virDomainChrDefFormat): Plug a leak on
an error path, and at the same time, eliminate the need for a
"cleanup:" block.  Before, the "return -1" after the switch
would leak an "addr" string.  Now, by reversing the port,addr-
getting blocks we can free "addr" immediately and skip the goto.
src/conf/domain_conf.c