From: Eric Blake Date: Fri, 21 Oct 2011 22:30:22 +0000 (-0600) Subject: storage: plug iscsi memory leak X-Git-Tag: v0.9.7-rc1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79052a76b5783008193e9ac3ebb348208622c323;p=thirdparty%2Flibvirt.git storage: plug iscsi memory leak 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. --- diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c index 99e69c9a63..c6e782d40b 100644 --- a/src/storage/storage_backend_iscsi.c +++ b/src/storage/storage_backend_iscsi.c @@ -611,6 +611,7 @@ cleanup: VIR_FREE(targets); VIR_FREE(portal); virStoragePoolSourceFree(source); + VIR_FREE(source); return ret; }