[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.4] libxc: Free logger after printing error message



commit 131fa5672a7fb349dd8c44315b1bea8b182efe1c
Author:     Jason Andryuk <andryuk@xxxxxxxx>
AuthorDate: Fri May 16 16:41:17 2014 -0400
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Thu May 22 17:02:53 2014 +0100

    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.
    
    Signed-off-by: Jason Andryuk <andryuk@xxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    (cherry picked from commit 86216963fd1d89883bb8120535704fdc79fdad50)
---
 tools/libxc/xc_private.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 33ed15b..0478f52 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -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;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.