mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-26 01:59:53 +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:
commit
8362637353
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user