diff mbox

libs/devicemodel: initialise op_bufs in xendevicemodel_xcall

Message ID 20170223151820.31922-1-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Feb. 23, 2017, 3:18 p.m. UTC
To avoid freeing uninitialised buffer when taking the first error exit
path.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
---
 tools/libs/devicemodel/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ian Jackson Feb. 23, 2017, 3:54 p.m. UTC | #1
Wei Liu writes ("[PATCH] libs/devicemodel: initialise op_bufs in xendevicemodel_xcall"):
> To avoid freeing uninitialised buffer when taking the first error exit
> path.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff mbox

Patch

diff --git a/tools/libs/devicemodel/core.c b/tools/libs/devicemodel/core.c
index 504543c1c5..19ebef63b3 100644
--- a/tools/libs/devicemodel/core.c
+++ b/tools/libs/devicemodel/core.c
@@ -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));