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

[Xen-changelog] [xen master] xentop: fix potential memory leak



commit f4d2d0e9a2159154e327a3f05b467824ae5e9e15
Author:     Charles Arnold <carnold@xxxxxxxx>
AuthorDate: Thu Apr 2 09:42:02 2015 -0600
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Apr 2 16:51:00 2015 +0100

    xentop: fix potential memory leak
    
    On a read failure the qstats buffer is not freed.
    
    Signed-off-by: Charles Arnold <carnold@xxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/xenstat/libxenstat/src/xenstat_qmp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_qmp.c 
b/tools/xenstat/libxenstat/src/xenstat_qmp.c
index c217b8e..2cb99e9 100644
--- a/tools/xenstat/libxenstat/src/xenstat_qmp.c
+++ b/tools/xenstat/libxenstat/src/xenstat_qmp.c
@@ -298,6 +298,7 @@ static int qmp_read(int qfd, unsigned char **qstats)
        while ((n = poll(pfd, POLLIN, 10)) > 0) {
                if (pfd[0].revents & POLLIN) {
                        if ((n = read(qfd, buf, sizeof(buf))) < 0) {
+                               free(*qstats);
                                return 0;
                        }
                        ptr = realloc(*qstats, qsize+n+1);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.