diff --git a/winpr/libwinpr/synch/semaphore.c b/winpr/libwinpr/synch/semaphore.c index 4c54fa12e..9e33d8a8a 100644 --- a/winpr/libwinpr/synch/semaphore.c +++ b/winpr/libwinpr/synch/semaphore.c @@ -39,6 +39,8 @@ HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lIniti WINPR_SEMAPHORE* semaphore; semaphore = (WINPR_SEMAPHORE*) malloc(sizeof(WINPR_SEMAPHORE)); + if (!semaphore) + return NULL; semaphore->pipe_fd[0] = -1; semaphore->pipe_fd[0] = -1;