diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-06-21 00:49:24 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-06-21 00:49:24 +0200 |
commit | 49cadc9114ab41cd853727c1b38b26fa901c49ca (patch) | |
tree | c494040f1ae1a503c43214adb082fcb6ac530ad1 /storage | |
parent | 166d4c1feb24b2d819af0b13fbf5dbad2b48c731 (diff) | |
download | mariadb-git-49cadc9114ab41cd853727c1b38b26fa901c49ca.tar.gz |
MDEV-361 - Fix handle leak in os_thread_create (Windows)
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/os/os0thread.c | 6 | ||||
-rw-r--r-- | storage/xtradb/os/os0thread.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c index 12b6805d98e..b19b5378fcd 100644 --- a/storage/innobase/os/os0thread.c +++ b/storage/innobase/os/os0thread.c @@ -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; diff --git a/storage/xtradb/os/os0thread.c b/storage/xtradb/os/os0thread.c index 12b6805d98e..b19b5378fcd 100644 --- a/storage/xtradb/os/os0thread.c +++ b/storage/xtradb/os/os0thread.c @@ -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; |