Initializing handles with calloc now.
This commit is contained in:
parent
9153af6a3e
commit
98b0f37020
@ -138,8 +138,8 @@ BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpP
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pReadPipe = (WINPR_PIPE*) malloc(sizeof(WINPR_PIPE));
|
||||
pWritePipe = (WINPR_PIPE*) malloc(sizeof(WINPR_PIPE));
|
||||
pReadPipe = (WINPR_PIPE*) calloc(1, sizeof(WINPR_PIPE));
|
||||
pWritePipe = (WINPR_PIPE*) calloc(1, sizeof(WINPR_PIPE));
|
||||
|
||||
if (!pReadPipe || !pWritePipe)
|
||||
{
|
||||
|
@ -123,13 +123,11 @@ BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
|
||||
if (!lpszUsername)
|
||||
return FALSE;
|
||||
|
||||
token = (WINPR_ACCESS_TOKEN*) malloc(sizeof(WINPR_ACCESS_TOKEN));
|
||||
token = (WINPR_ACCESS_TOKEN*) calloc(1, sizeof(WINPR_ACCESS_TOKEN));
|
||||
|
||||
if (!token)
|
||||
return FALSE;
|
||||
|
||||
ZeroMemory(token, sizeof(WINPR_ACCESS_TOKEN));
|
||||
|
||||
WINPR_HANDLE_SET_TYPE(token, HANDLE_TYPE_ACCESS_TOKEN);
|
||||
|
||||
token->cb.GetFd = LogonUserGetFd;
|
||||
|
@ -73,7 +73,7 @@ HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
|
||||
HANDLE handle = NULL;
|
||||
WINPR_MUTEX* mutex;
|
||||
|
||||
mutex = (WINPR_MUTEX*) malloc(sizeof(WINPR_MUTEX));
|
||||
mutex = (WINPR_MUTEX*) calloc(1, sizeof(WINPR_MUTEX));
|
||||
|
||||
if (mutex)
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lIniti
|
||||
HANDLE handle;
|
||||
WINPR_SEMAPHORE* semaphore;
|
||||
|
||||
semaphore = (WINPR_SEMAPHORE*) malloc(sizeof(WINPR_SEMAPHORE));
|
||||
semaphore = (WINPR_SEMAPHORE*) calloc(1, sizeof(WINPR_SEMAPHORE));
|
||||
|
||||
if (!semaphore)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user