diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-04-22 14:59:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-23 13:42:33 +0200 |
commit | 45340f9fc77e254924f129c764b685fe682e380c (patch) | |
tree | 654d93801dd11ed751e73d3ca0fe87dfacb75076 /libavformat | |
parent | 60191e3aec6a65ffcb8af9ad389df7ce31293e6d (diff) | |
download | ffmpeg-45340f9fc77e254924f129c764b685fe682e380c.tar.gz |
network: Do not leave context locked on error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/network.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/network.c b/libavformat/network.c index e9eab297e2..57a5b418e7 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -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); |