[libvirt] [PATCH 1/2] storage: plug iscsi memory leak
Laine Stump
laine at laine.org
Mon Oct 24 23:55:25 UTC 2011
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.
More information about the libvir-list
mailing list