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

This commit is contained in:
Vladislav Vaintroub 2012-06-21 00:49:24 +02:00
parent 166d4c1feb
commit 49cadc9114
2 changed files with 8 additions and 4 deletions

View file

@ -136,8 +136,10 @@ os_thread_create(
if (thread_id) {
*thread_id = win_thread_id;
}
return(thread);
if (thread) {
CloseHandle(thread);
}
return((os_thread_t)win_thread_id);
#else
int ret;
os_thread_t pthread;

View file

@ -136,8 +136,10 @@ os_thread_create(
if (thread_id) {
*thread_id = win_thread_id;
}
return(thread);
if (thread) {
CloseHandle(thread);
}
return((os_thread_t)win_thread_id);
#else
int ret;
os_thread_t pthread;