Re: [PATCH 1/2] storage: plug iscsi memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/21/2011 06:46 PM, Eric Blake wrote:
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 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 99e69c9..c6e782d 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;
  }


ACK.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]