[libvirt] [PATCH 0/6] Fix some Coverity issues

John Ferlan jferlan at redhat.com
Wed Sep 23 23:18:27 UTC 2015

Newer Coverity (7.7.0) found a couple real issues and a few more
false positives. There's still a few more to be resolved, but still
trying to figure them out...

libxlDomainMigrationPrepare - claim is args is leaked. Although
    it seems to be handled in libxlMigrateReceive or libxlDoMigrateReceive.
    Don't know the code well enough to do proper triage.

qemuProcessStop - claim is usage of net->ifname in the condition
    is using a NULL net->ifname that would have been VIR_FREE()'d
    when case VIR_DOMAIN_NET_TYPE_DIRECT a few lines above.

qemuDomainBlockRebase - claim is overwriting 'dest' after call to
   qemuDomainBlockCopyCommon causes resource leak.  Although reading
   code says otherwise, except of course if CopyCommon goes to cleanup
   rather than endjob.  Even changing the location doesn't resolve
   the issue.

Fix the Coverity tag for the DEADCODE... It's always a coin-flip either
dead_error_begin or dead_error_condition - I gave Jiri bad advice as
to which one to use it seems.

John Ferlan (6):
  Avoid Coverity FORWARD_NULL prior to strtok_r calls
  tests: Resolve Coverity RESOURCE_LEAK
  tests: Resolve Coverity RESOURCE_LEAK
  virsh: Resolve Coverity DEADCODE
  qemu: Resolve Coverity CHECKED_RETURN
  qemu: Resolve Coverity RESOURCE_LEAK

 src/esx/esx_vi.c          |  1 +
 src/libxl/libxl_conf.c    |  1 +
 src/openvz/openvz_conf.c  |  2 ++
 src/qemu/qemu_driver.c    | 24 +++++++++++-------------
 src/qemu/qemu_process.c   |  6 +++---
 src/xenapi/xenapi_utils.c |  1 +
 tests/qemucaps2xmltest.c  |  1 +
 tests/virnetdaemontest.c  |  2 ++
 tools/virsh.c             |  2 +-
 9 files changed, 23 insertions(+), 17 deletions(-)


More information about the libvir-list mailing list