Theoretical memory leak where if attr_init failed, then check would have still been malloc'd but not used.
This commit is contained in:
parent
e2ea6e58c8
commit
b4209ca93b
|
@ -148,8 +148,10 @@ ESL_DECLARE(esl_status_t) esl_mutex_create(esl_mutex_t **mutex)
|
|||
#ifdef WIN32
|
||||
InitializeCriticalSection(&check->mutex);
|
||||
#else
|
||||
if (pthread_mutexattr_init(&attr))
|
||||
if (pthread_mutexattr_init(&attr)) {
|
||||
free(check);
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE))
|
||||
goto fail;
|
||||
|
|
Loading…
Reference in New Issue