xl: free event in DOMAIN_RESTART_RENAME error path
authorWei Liu <wei.liu2@citrix.com>
Thu, 2 Feb 2017 15:30:32 +0000 (15:30 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 3 Feb 2017 12:02:44 +0000 (12:02 +0000)
Otherwise it is leaked. Found by code inspection.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c

index 196b8a685130a9869df37329af308108ace04c0f..b25ac6efa07ca03d104923f9d2b921fc0df36127 100644 (file)
@@ -3146,6 +3146,7 @@ start:
             case DOMAIN_RESTART_RENAME:
                 if (domid_soft_reset == INVALID_DOMID &&
                     !preserve_domain(&domid, event, &d_config)) {
+                    libxl_event_free(ctx, event);
                     /* If we fail then exit leaving the old domain in place. */
                     ret = -1;
                     goto out;