commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r810391 - /commons/sandbox/runtime/trunk/src/main/native/os/win32/ios.c
Date Wed, 02 Sep 2009 07:38:15 GMT
Author: mturk
Date: Wed Sep  2 07:38:14 2009
New Revision: 810391

URL: http://svn.apache.org/viewvc?rev=810391&view=rev
Log:
Check rv from lock init

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/ios.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/ios.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/ios.c?rev=810391&r1=810390&r2=810391&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/ios.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/ios.c Wed Sep  2 07:38:14 2009
@@ -105,8 +105,19 @@
      */
     __bitmap[0] = 0xFF;
     __bmp_hint  = 1;
-    InitializeCriticalSectionAndSpinCount(&ios_lock, ACR_SPINCOUNT);
+    
+    if (!InitializeCriticalSectionAndSpinCount(&ios_lock, ACR_SPINCOUNT)) {
+        /* 
+         * No point to continue.
+         */
+        free(acr_ioh_tab);
+        acr_ioh_mask = 0;
+        acr_ioh_tab  = &nul_ioh_tab;
+        free(__bitmap);
+        __bitmap = NULL;
 
+        return ACR_ENOMEM;
+    }
     return 0;
 }
 



Mime
View raw message