提交 45340f9f 编写于 作者: V Vittorio Giovara 提交者: Michael Niedermayer

network: Do not leave context locked on error

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 60191e3a
......@@ -77,8 +77,10 @@ int ff_tls_init(void)
if (!CRYPTO_get_locking_callback()) {
int i;
openssl_mutexes = av_malloc_array(sizeof(pthread_mutex_t), CRYPTO_num_locks());
if (!openssl_mutexes)
if (!openssl_mutexes) {
avpriv_unlock_avformat();
return AVERROR(ENOMEM);
}
for (i = 0; i < CRYPTO_num_locks(); i++)
pthread_mutex_init(&openssl_mutexes[i], NULL);
CRYPTO_set_locking_callback(openssl_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册