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

[Xen-devel] [PATCH 2/2] libxl: Do not leak data on error path from libxl__read_sysfs_file_contents

Bug introduced in bc023ecd
"libxl_utils: add internal function to read sysfs file contents"

CID: 1358108
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CC: coverity@xxxxxxxxxxxxxx
CC: Chunyan Liu <cyliu@xxxxxxxx>
 tools/libxl/libxl_utils.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index ceb8825..bd58a52 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -466,6 +466,7 @@ int libxl__read_sysfs_file_contents(libxl__gc *gc, const 
char *filename,
     e = errno;
     assert(e != ENOENT);
     if (f) fclose(f);
+    free(data);
     return e;

Xen-devel mailing list



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