From: Donghwa Jeong Date: Tue, 12 Jun 2018 09:16:35 +0000 (+0900) Subject: attach: fix double free X-Git-Tag: lxc-2.0.10~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=027adbcf5125032a9946b8280b632e34d5484346;p=thirdparty%2Flxc.git attach: fix double free Signed-off-by: Donghwa Jeong --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index cb1d7b977..6d921223f 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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