From 79052a76b5783008193e9ac3ebb348208622c323 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 21 Oct 2011 16:30:22 -0600 Subject: [PATCH] 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. --- src/storage/storage_backend_iscsi.c | 1 + 1 file changed, 1 insertion(+) 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; }