]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: fix double free
authorDonghwa Jeong <dh48.jeong@samsung.com>
Tue, 12 Jun 2018 09:16:35 +0000 (18:16 +0900)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 08:15:45 +0000 (09:15 +0100)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/lxc/attach.c

index cb1d7b97705648ce06ffe6cf5982d8259704db05..6d921223f9c7149d18c2702f12fbbe54889bfef0 100644 (file)
@@ -166,7 +166,6 @@ static void lxc_proc_put_context_info(struct lxc_proc_context_info *ctx)
 
        lxc_proc_close_ns_fd(ctx);
        free(ctx);
-       ctx = NULL;
 }
 
 /**
@@ -862,6 +861,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