From: Roger Pau Monne Date: Thu, 21 Nov 2013 16:18:00 +0000 (+0100) Subject: libxl: fix use of aodev->dev after free X-Git-Tag: 4.4.0-rc1~163 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5280b7bd26cc93e4a46f0ac6d7706d96e9222154;p=xen.git libxl: fix use of aodev->dev after free Coverity-ID: 1130521 Signed-off-by: Roger Pau Monné Cc: Ian Campbell Acked-by: Ian Jackson --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 4292c78010..ed3293127d 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3596,14 +3596,14 @@ static void device_complete(libxl__egc *egc, libxl__ao_device *aodev) { STATE_AO_GC(aodev->ao); - if (aodev->action == LIBXL__DEVICE_ACTION_REMOVE) - free(aodev->dev); - LOG(DEBUG, "device %s %s %s", libxl__device_backend_path(gc, aodev->dev), libxl__device_action_to_string(aodev->action), aodev->rc ? "failed" : "succeed"); + if (aodev->action == LIBXL__DEVICE_ACTION_REMOVE) + free(aodev->dev); + libxl__nested_ao_free(aodev->ao); }