xentop: fix potential memory leak
PATCH 1/1 xentop: fix potential memory leak
On a read failure the qstats buffer is not freed.
Signed-off-by Charles Arnold <[email protected]>
tools/xenstat/libxenstat/src/xenstat_qmp.c +1 -0
@@ -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 );
Quoted 3 lines · Charles Arnold
On a read failure the qstats buffer is not freed.
Signed-off-by Charles Arnold <[email protected]>
Acked + applied, thanks for the quick response!