[libvirt] [PATCH] Eliminate memory leak in xenUnifiedDomainInfoListFree

From: Laine Stump <laine@redhat.com> This fixes a leak described in https://bugzilla.redhat.com/show_bug.cgi?id=590073 xenUnifiedDomainInfoList has a pointer to a list of pointers to xenUnifiedDomain. We were freeing up all the domains, but neglecting to free the list. This was found by Paolo Bonzini <pbonzini@redhat.com>. --- src/xen/xen_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index d121ea4..ddbfa7a 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -2044,6 +2044,7 @@ xenUnifiedDomainInfoListFree(xenUnifiedDomainInfoListPtr list) VIR_FREE(list->doms[i]->name); VIR_FREE(list->doms[i]); } + VIR_FREE(list->doms); VIR_FREE(list); } -- 1.7.1.1

On 07/29/2010 07:47 AM, Laine Stump wrote:
From: Laine Stump <laine@redhat.com>
This fixes a leak described in
https://bugzilla.redhat.com/show_bug.cgi?id=590073
xenUnifiedDomainInfoList has a pointer to a list of pointers to xenUnifiedDomain. We were freeing up all the domains, but neglecting to free the list.
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 07/29/2010 10:10 AM, Eric Blake wrote:
On 07/29/2010 07:47 AM, Laine Stump wrote:
From: Laine Stump<laine@redhat.com>
This fixes a leak described in
https://bugzilla.redhat.com/show_bug.cgi?id=590073
xenUnifiedDomainInfoList has a pointer to a list of pointers to xenUnifiedDomain. We were freeing up all the domains, but neglecting to free the list. ACK.
Thanks! Pushed.

On 07/29/10 - 09:47:53AM, Laine Stump wrote:
From: Laine Stump <laine@redhat.com>
This fixes a leak described in
https://bugzilla.redhat.com/show_bug.cgi?id=590073
xenUnifiedDomainInfoList has a pointer to a list of pointers to xenUnifiedDomain. We were freeing up all the domains, but neglecting to free the list.
This was found by Paolo Bonzini <pbonzini@redhat.com>. --- src/xen/xen_driver.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index d121ea4..ddbfa7a 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -2044,6 +2044,7 @@ xenUnifiedDomainInfoListFree(xenUnifiedDomainInfoListPtr list) VIR_FREE(list->doms[i]->name); VIR_FREE(list->doms[i]); } + VIR_FREE(list->doms); VIR_FREE(list); }
Ouch. ACK -- Chris Lalancette
participants (3)
-
Chris Lalancette
-
Eric Blake
-
Laine Stump