apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r437115 - /apr/apr/trunk/misc/win32/start.c
Date Sat, 26 Aug 2006 07:34:42 GMT
Author: mturk
Date: Sat Aug 26 00:34:41 2006
New Revision: 437115

URL: http://svn.apache.org/viewvc?rev=437115&view=rev
Log:
Check if the return value from TlsGetValue is
valid before calling the provided callback.

Modified:
    apr/apr/trunk/misc/win32/start.c

Modified: apr/apr/trunk/misc/win32/start.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/win32/start.c?rev=437115&r1=437114&r2=437115&view=diff
==============================================================================
--- apr/apr/trunk/misc/win32/start.c (original)
+++ apr/apr/trunk/misc/win32/start.c Sat Aug 26 00:34:41 2006
@@ -234,7 +234,12 @@
         void *data;
         apr_hash_this(hi, &key, NULL, (void **)&dest);
         data = TlsGetValue(*key);
-        (*dest)(data);
+        if (data != NULL || GetLastError() == ERROR_SUCCESS) {
+            /* NULL data is a valid TLS value if explicitly set
+             * by the TlsSetValue
+             */
+            (*dest)(data);
+        }
     }
 }
 



Mime
View raw message