Merge pull request #2397 from 2xsec/bugfix

attach: fix double free
This commit is contained in:
Christian Brauner 2018-06-12 11:31:37 +02:00 committed by GitHub
commit 5465e67305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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