1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-11-27 22:01:33 +03:00

Merge pull request #1749 from chipitsine/master

src/Mayaqua/Unix.c: improve memory allocation handling according to Coverity
This commit is contained in:
Ilya Shipitsin
2023-01-15 22:09:00 +06:00
committed by GitHub

View File

@ -1869,11 +1869,16 @@ LOCK *UnixNewLock()
pthread_mutex_t *mutex;
// Memory allocation
LOCK *lock = UnixMemoryAlloc(sizeof(LOCK));
if (lock == NULL)
{
return NULL;
}
// Create a mutex
mutex = UnixMemoryAlloc(sizeof(pthread_mutex_t));
if (mutex == NULL)
{
UnixMemoryFree(lock);
return NULL;
}