]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Avoid false positive of uninitialized variable use
authorPeter Krempa <pkrempa@redhat.com>
Tue, 17 Sep 2013 11:27:58 +0000 (13:27 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Sep 2013 11:57:32 +0000 (13:57 +0200)
commit0d4f469c871fb5997bb24f192924163263445980
tree26ead372fd78eb71a11cf0102dc2c084520fbc05
parent716c7bb1dd6ec7d3e19a11e4a3de1cf744d8ac60
conf: Avoid false positive of uninitialized variable use

GCC 4.8.0+ whines about variable "new" being uninitialized since
commit 73bfac0e7182a3abd. This is a false positive as the
xmlFreeNode(new) statement can be only reached if new was actually
allocated successfully.

  CC       conf/libvirt_conf_la-domain_conf.lo
  conf/domain_conf.c: In function 'virDomainDefSetMetadata':
  conf/domain_conf.c:18650:24: error: 'new' may be used uninitialized in this function [-Werror=maybe-uninitialized]
               xmlFreeNode(new);

Reported independently by John Ferlan and Michal Privoznik.
src/conf/domain_conf.c