From 09cd5c9bdb8c3c48fadcef6c92da2b67acbfcb47 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Wed, 20 Apr 2022 04:12:41 +0800 Subject: c11: Fixes memory leak of pack in thrd_create on win32 Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Part-of: --- src/c11/impl/threads_win32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/c11/impl/threads_win32.c b/src/c11/impl/threads_win32.c index 08c9475d81c..5d78542dab4 100644 --- a/src/c11/impl/threads_win32.c +++ b/src/c11/impl/threads_win32.c @@ -319,6 +319,7 @@ thrd_create(thrd_t *thr, thrd_start_t func, void *arg) pack->arg = arg; handle = _beginthreadex(NULL, 0, impl_thrd_routine, pack, 0, NULL); if (handle == 0) { + free(pack); if (errno == EAGAIN || errno == EACCES) return thrd_nomem; return thrd_error; -- cgit v1.2.3