From e5d691977dca7c2568b671753791244ff48d2c14 Mon Sep 17 00:00:00 2001 From: Daiyuu Nobori Date: Wed, 1 Jan 2020 10:59:24 +0900 Subject: [PATCH] Bugfix: OpenVPN Certificate Authentication may cause process crush. --- src/Cedar/IPC.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Cedar/IPC.c b/src/Cedar/IPC.c index 377b5d59..ffa9baaa 100644 --- a/src/Cedar/IPC.c +++ b/src/Cedar/IPC.c @@ -82,6 +82,12 @@ IPC_ASYNC *NewIPCAsync(CEDAR *cedar, IPC_PARAM *param, SOCK_EVENT *sock_event) Copy(&a->Param, param, sizeof(IPC_PARAM)); + if (param->ClientCertificate != NULL) + { + // Client certificate must be copied for async processing + a->Param.ClientCertificate = CloneX(param->ClientCertificate); + } + if (sock_event != NULL) { a->SockEvent = sock_event; @@ -200,6 +206,12 @@ void FreeIPCAsync(IPC_ASYNC *a) ReleaseCedar(a->Cedar); ReleaseTube(a->TubeForDisconnect); + + if (a->Param.ClientCertificate != NULL) + { + FreeX(a->Param.ClientCertificate); + } + Free(a); }