[libvirt] [PATCH] Fix memory leak in virStorageBackendCopyToFD

--- src/storage/storage_backend.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index a3b4d5a..9dc801c 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -198,6 +198,8 @@ cleanup: if (inputfd != -1) close(inputfd); + VIR_FREE(buf); + return ret; } -- 1.6.0.4

On Fri, Dec 11, 2009 at 02:12:46AM +0100, Matthias Bolte wrote:
--- src/storage/storage_backend.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index a3b4d5a..9dc801c 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -198,6 +198,8 @@ cleanup: if (inputfd != -1) close(inputfd);
+ VIR_FREE(buf); + return ret; }
Good catch, ACK ! thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2009/12/11 Daniel Veillard <veillard@redhat.com>:
On Fri, Dec 11, 2009 at 02:12:46AM +0100, Matthias Bolte wrote:
--- src/storage/storage_backend.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index a3b4d5a..9dc801c 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -198,6 +198,8 @@ cleanup: if (inputfd != -1) close(inputfd);
+ VIR_FREE(buf); + return ret; }
Good catch, ACK !
thanks !
Daniel
Also found by using the TCK and valgrind. Okay, pushed. Matthias
participants (2)
-
Daniel Veillard
-
Matthias Bolte