Commit 21ab6938 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-361 - Fix handle leak in os_thread_create (Windows)

parent 2c6e0a8d
...@@ -136,8 +136,10 @@ os_thread_create( ...@@ -136,8 +136,10 @@ os_thread_create(
if (thread_id) { if (thread_id) {
*thread_id = win_thread_id; *thread_id = win_thread_id;
} }
if (thread) {
return(thread); CloseHandle(thread);
}
return((os_thread_t)win_thread_id);
#else #else
int ret; int ret;
os_thread_t pthread; os_thread_t pthread;
......
...@@ -136,8 +136,10 @@ os_thread_create( ...@@ -136,8 +136,10 @@ os_thread_create(
if (thread_id) { if (thread_id) {
*thread_id = win_thread_id; *thread_id = win_thread_id;
} }
if (thread) {
return(thread); CloseHandle(thread);
}
return((os_thread_t)win_thread_id);
#else #else
int ret; int ret;
os_thread_t pthread; os_thread_t pthread;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment