ffmpeg | branch: master | Vittorio Giovara <vittorio.giov...@gmail.com> | Wed 
Apr 22 14:59:55 2015 +0100| [45340f9fc77e254924f129c764b685fe682e380c] | 
committer: Michael Niedermayer

network: Do not leave context locked on error

Signed-off-by: Michael Niedermayer <michae...@gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=45340f9fc77e254924f129c764b685fe682e380c
---

 libavformat/network.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index e9eab29..57a5b41 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);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to