提交 b4209ca9 authored 作者: William King's avatar William King

Theoretical memory leak where if attr_init failed, then check would have still…

Theoretical memory leak where if attr_init failed, then check would have still been malloc'd but not used.
上级 e2ea6e58
......@@ -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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论