From: Tom Yu Date: Mon, 25 Sep 2006 21:06:43 +0000 (+0000) Subject: pull up r18600 from trunk X-Git-Tag: kfw-3.1.0-beta2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b54d34d5f4378ecab093ef54dd9315c0e8cf6628;p=krb5.git pull up r18600 from trunk r18600@cathode-dark-space: jaltman | 2006-09-20 22:43:12 -0400 ticket: new subject: windows thread support frees thread local storage after TlsSetValue tags: pullup threads.c: The return value of TlsSetValue is non-zero on success. As a result of misinterpreting the return value, the memory set in TLS is then freed. A subsequent call to TlsGetValue returns the invalid pointer. ticket: 4305 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@18611 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/support/threads.c b/src/util/support/threads.c index b9fd3c116..eb5fd2ff6 100644 --- a/src/util/support/threads.c +++ b/src/util/support/threads.c @@ -275,9 +275,9 @@ int k5_setspecific (k5_key_t keynum, void *value) /* add to global linked list */ /* t->next = 0; */ err = TlsSetValue(tls_idx, t); - if (err) { + if (!err) { free(t); - return err; + return GetLastError(); } }