]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
libxc/xc_sr_save.c: initialise rec.data before free()
authorJoshua Otto <jtotto@uwaterloo.ca>
Mon, 27 Mar 2017 09:06:22 +0000 (05:06 -0400)
committerWei Liu <wei.liu2@citrix.com>
Wed, 29 Mar 2017 17:27:49 +0000 (18:27 +0100)
colo_merge_secondary_dirty_bitmap() unconditionally free()s the .data
member of its local xc_sr_record structure rec on its exit path.
However, if the initial call to read_record() fails then this member is
uninitialised.  Initialise it.

Signed-off-by: Joshua Otto <jtotto@uwaterloo.ca>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_sr_save.c

index f98c8276d47cd39028bad333c5e7c070e7865d00..ca6913b723252f32bd1fb8db51d529b965329d2a 100644 (file)
@@ -520,7 +520,7 @@ static int send_memory_live(struct xc_sr_context *ctx)
 static int colo_merge_secondary_dirty_bitmap(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    struct xc_sr_record rec;
+    struct xc_sr_record rec = { 0, 0, NULL };
     uint64_t *pfns = NULL;
     uint64_t pfn;
     unsigned count, i;