projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a362e2
)
xentop: fix potential memory leak
author
Charles Arnold
<carnold@suse.com>
Thu, 2 Apr 2015 15:42:02 +0000
(09:42 -0600)
committer
Ian Campbell
<ian.campbell@citrix.com>
Thu, 2 Apr 2015 15:51:00 +0000
(16:51 +0100)
On a read failure the qstats buffer is not freed.
Signed-off-by: Charles Arnold <carnold@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstat/libxenstat/src/xenstat_qmp.c
patch
|
blob
|
history
diff --git
a/tools/xenstat/libxenstat/src/xenstat_qmp.c
b/tools/xenstat/libxenstat/src/xenstat_qmp.c
index c217b8e78b965de973f5185f715cef76dbdf6954..2cb99e9a607fbad00d20e10cadb1a6b77e0db783 100644
(file)
--- 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);