Skip to contentSkip to conversation

libs/devicemodel: initialise op_bufs in xendevicemodel_xcall

PATCH In review Wei Liu 2 participants 2 messages Feb 23, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libs/devicemodel: initialise op_bufs in xendevicemodel_xcall

To avoid freeing uninitialised buffer when taking the first error exit path.

---
Cc: Ian Jackson <[email protected]>
Cc: Paul Durrant <[email protected]>

---
 tools/libs/devicemodel/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libs/devicemodel/core.c +1 -1
index 504543c1c5..19ebef63b3 100644
@@ -79,7 +79,7 @@ int xendevicemodel_xcall(xendevicemodel_handle *dmod,
 {
     int ret = -1;
     void **xcall_bufs;
-    xen_dm_op_buf_t *op_bufs;
+    xen_dm_op_buf_t *op_bufs = NULL;
     unsigned int i;
 
     xcall_bufs = calloc(nr_bufs, sizeof(*xcall_bufs));
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel