]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
tools: libxencall/foreignmemory: initialise handle->fd
authorIan Campbell <ian.campbell@citrix.com>
Wed, 3 Feb 2016 10:09:42 +0000 (10:09 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 3 Feb 2016 11:23:43 +0000 (11:23 +0000)
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@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libs/call/core.c
tools/libs/foreignmemory/core.c

index bbf88de9df8e1077bc778225092e8a598de779ff..5ca037237f0d571f13c1523a53cd85a715faa517 100644 (file)
@@ -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;
 
index a5110a765c70c978c2a8d3da91553b01a5e21506..a872b9555d8f98aceda96ce307df7c5765778e70 100644 (file)
@@ -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;