projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix ex_data locks issue
[openssl.git]
/
crypto
/
threads_win.c
diff --git
a/crypto/threads_win.c
b/crypto/threads_win.c
index bee628ff8196597bba03d8c2a7d873935529beef..63647a39a673dc37e3ab0bd513b82d4cb6331934 100644
(file)
--- a/
crypto/threads_win.c
+++ b/
crypto/threads_win.c
@@
-59,8
+59,10
@@
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
return NULL;
/* 0x400 is the spin count value suggested in the documentation */
return NULL;
/* 0x400 is the spin count value suggested in the documentation */
- if (!InitializeCriticalSectionAndSpinCount(lock, 0x400))
+ if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {
+ OPENSSL_free(lock);
return NULL;
return NULL;
+ }
return lock;
}
return lock;
}
@@
-131,12
+133,12
@@
BOOL CALLBACK once_cb(PINIT_ONCE once, PVOID p, PVOID *pp)
return TRUE;
}
return TRUE;
}
-
void
CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
+
int
CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
{
if (InitOnceExecuteOnce(once, once_cb, init, NULL))
{
if (InitOnceExecuteOnce(once, once_cb, init, NULL))
- return
0
;
+ return
1
;
- return
1
;
+ return
0
;
}
# endif
}
# endif