]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: fix double free 2397/head
authorDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 12 Jun 2018 09:16:35 +0000 (18:16 +0900)
committerDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 12 Jun 2018 09:16:35 +0000 (18:16 +0900)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/lxc/attach.c

index b62dcecfac481cd7ae59add162197c0355957e53..9bbdd0e6a0b509447a2c1d0d55e4d9bf623d05b7 100644 (file)
@@ -172,7 +172,6 @@ static void lxc_proc_put_context_info(struct lxc_proc_context_info *ctx)
 
        lxc_proc_close_ns_fd(ctx);
        free(ctx);
-       ctx = NULL;
 }
 
 /**
@@ -908,6 +907,7 @@ static int attach_child_main(struct attach_clone_payload *payload)
        close(payload->ipc_socket);
        payload->ipc_socket = -EBADF;
        lxc_proc_put_context_info(init_ctx);
+       payload->init_ctx = NULL;
 
        /* The following is done after the communication socket is shut down.
         * That way, all errors that might (though unlikely) occur up until this