]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: plug iscsi memory leak
authorEric Blake <eblake@redhat.com>
Fri, 21 Oct 2011 22:30:22 +0000 (16:30 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 25 Oct 2011 01:32:25 +0000 (19:32 -0600)
Detected by Coverity.  virStoragePoolSourceFree does not free the
actual passed-in pointer.  A bigger patch would be to rename it
virStoragePoolSourceClear to match behavior, or even split it into
two functions depending on needed behavior; but this is the minimal
fix to the one location out of eight that leaked memory.

* src/storage/storage_backend_iscsi.c
(virStorageBackendISCSIFindPoolSources): Free memory.

src/storage/storage_backend_iscsi.c

index 99e69c9a63179c301ce77f1d574e80d190247de3..c6e782d40bcf2e9dce6f2fd6f7411b1f80f20287 100644 (file)
@@ -611,6 +611,7 @@ cleanup:
     VIR_FREE(targets);
     VIR_FREE(portal);
     virStoragePoolSourceFree(source);
+    VIR_FREE(source);
     return ret;
 }