You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/04/14 16:18:31 UTC

svn commit: r1092266 - /commons/sandbox/runtime/trunk/src/main/native/os/win32/winapi.c

Author: mturk
Date: Thu Apr 14 14:18:31 2011
New Revision: 1092266

URL: http://svn.apache.org/viewvc?rev=1092266&view=rev
Log:
LocalAlloc(LPTR, ..) is actually calloc

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

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/winapi.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/winapi.c?rev=1092266&r1=1092265&r2=1092266&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/winapi.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/winapi.c Thu Apr 14 14:18:31 2011
@@ -45,14 +45,14 @@ static PSECURITY_ATTRIBUTES GetSaWithNul
         _zero_SA[si].lpSecurityDescriptor = 0;
     }
 
-    if (!(_null_SA[si] = malloc(sizeof(SECURITY_ATTRIBUTES)))) {
+    if (!(_null_SA[si] = calloc(1, sizeof(SECURITY_ATTRIBUTES)))) {
         rc = ACR_ENOMEM;
         ACR_THROW(ACR_EX_ENOMEM, 0);
         goto cleanup;
     }
     _null_SA[si]->nLength = TSIZEOF(DWORD, SECURITY_ATTRIBUTES);
 
-    pSD = malloc(SECURITY_DESCRIPTOR_MIN_LENGTH);
+    pSD = calloc(1, SECURITY_DESCRIPTOR_MIN_LENGTH);
     if (pSD == 0) {
         rc = ACR_ENOMEM;
         ACR_THROW(ACR_EX_ENOMEM, 0);