1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

network: Do not leave context locked on error

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 45340f9fc7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Vittorio Giovara 2015-04-22 14:59:55 +01:00 committed by Michael Niedermayer
parent 2ac7a0d999
commit 485f53548b

View File

@ -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);