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

[Xen-devel] [PATCH] tools: libxencall/foreignmemory: initialise handle->fd



Otherwise the osdep close on the error path touches an uninitialised
varialble.

CID: 1351231 (foreignmemory) and 1351230 (call)

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libs/call/core.c          | 2 ++
 tools/libs/foreignmemory/core.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index bbf88de..5ca0372 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -24,6 +24,8 @@ xencall_handle *xencall_open(xentoollog_logger *logger, 
unsigned open_flags)
 
     if (!xcall) return NULL;
 
+    xcall->fd = -1;
+
     xcall->flags = open_flags;
     xcall->buffer_cache_nr = 0;
 
diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index cfb0a73..6591888 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -27,6 +27,7 @@ xenforeignmemory_handle 
*xenforeignmemory_open(xentoollog_logger *logger,
 
     if (!fmem) return NULL;
 
+    fmem->fd = -1;
     fmem->logger = logger;
     fmem->logger_tofree = NULL;
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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