libxc: Free logger after printing error message
PATCH 1/1 libxc: Free logger after printing error message
On error, PERROR calls the already destroyed logger, which can segfault. Re-order the calls, so the logger is still available.
--- tools/libxc/xc_private.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/libxc/xc_private.c +3 -3
@@ -201,14 +201,14 @@ static int xc_interface_close_common(xc_interface *xch)if (!xch)return 0 ; + rc = xch->ops->close (xch, xch->ops_handle); +if (rc)PERROR ("Could not close hypervisor interface" ); +xc__hypercall_buffer_cache_release (xch);xtl_logger_destroy (xch->dombuild_logger_tofree);xtl_logger_destroy (xch->error_handler_tofree); - rc = xch->ops->close (xch, xch->ops_handle); -if (rc)PERROR ("Could not close hypervisor interface" ); -free (xch);return rc; }
Signature · 1 line
1.8.3.1
Jason Andryuk writes ("[PATCH] libxc: Free logger after printing error message"):
Quoted 2 lines
On error, PERROR calls the already destroyed logger, which can segfault. Re-order the calls, so the logger is still available.
Thanks,
Ian.
Jason Andryuk writes ("[PATCH] libxc: Free logger after printing error message"):
Quoted 2 lines
On error, PERROR calls the already destroyed logger, which can segfault. Re-order the calls, so the logger is still available.
I have also added this to my list of patches to be backported.
Thanks,
Ian.
Ian Jackson writes ("Re: [PATCH] libxc: Free logger after printing error message"):
Quoted 5 lines
Jason Andryuk writes ("[PATCH] libxc: Free logger after printing error message"):
Quoted 2 lines
On error, PERROR calls the already destroyed logger, which can segfault. Re-order the calls, so the logger is still available.
I have also added this to my list of patches to be backported.
Now backported to 4.4 and will be pushed there shortly. It's inapplicable to 4.3.
Thanks,
Ian.