summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-06-21 00:49:24 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2012-06-21 00:49:24 +0200
commit49cadc9114ab41cd853727c1b38b26fa901c49ca (patch)
treec494040f1ae1a503c43214adb082fcb6ac530ad1 /storage
parent166d4c1feb24b2d819af0b13fbf5dbad2b48c731 (diff)
downloadmariadb-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.c6
-rw-r--r--storage/xtradb/os/os0thread.c6
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;