]> xenbits.xensource.com Git - libvirt.git/commit
xen_common: Resolve Coverity USE_AFTER_FREE
authorJohn Ferlan <jferlan@redhat.com>
Wed, 27 Aug 2014 11:40:02 +0000 (07:40 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 27 Aug 2014 16:52:27 +0000 (12:52 -0400)
commit0454f23c3125ef7bd3ffd1f5fa9643c108d9a4d4
tree11afaf8b3835c7e0d06d509eedf71d577bf7191d
parent0da9a8a8bffc682b7a13c1d8d68744970d12a22c
xen_common: Resolve Coverity USE_AFTER_FREE

There were two warnings in this module

  If the VIR_ALLOC_N(def->serials, 1) fails, then a virDomainChrDefFree(chr)
  is called and we jump to cleanup which makes the same call. Just remove
  the one after VIR_ALLOC_N()

  In the label "skipnic:" a virDomainNetDefFree(net) is made; however, if
  in going back to the top of the loop we jump back down to skipnic for any
  reason, the call will attempt to free an already freed structure since
  "net" was not passed by reference to virDomainNetDefFree().  Just set
  net = NULL in skipnic: to resolve the issue.
src/xenconfig/xen_common.c