1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 09:29:52 +03:00

Merge PR #1273: fix null pointer dereference found by ErrorSanitizer

This commit is contained in:
Davide Beatrici 2021-02-21 14:10:08 +01:00 committed by GitHub
commit ea2c8f9861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1840,6 +1840,10 @@ LOCK *UnixNewLock()
// Create a mutex // Create a mutex
mutex = UnixMemoryAlloc(sizeof(pthread_mutex_t)); mutex = UnixMemoryAlloc(sizeof(pthread_mutex_t));
if (mutex == NULL)
{
return NULL;
}
// Initialization of the mutex // Initialization of the mutex
pthread_mutex_init(mutex, NULL); pthread_mutex_init(mutex, NULL);