[FFmpeg-devel] [PATCH 1/2] lavf/http.c: Free allocated client URLContext in case of error.

Stephan Holljes klaxa1337 at googlemail.com
Tue Apr 11 21:05:01 EEST 2017


---

This version returns 0 in case of success and does not fallthrough to fail:.

 libavformat/http.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/http.c b/libavformat/http.c
index 293a8a7..2917b6e 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -535,7 +535,11 @@ static int http_accept(URLContext *s, URLContext **c)
         goto fail;
     cc->hd = cl;
     cc->is_multi_client = 1;
+    return 0;
 fail:
+    if (c) {
+        ffurl_close(*c);
+    }
     return ret;
 }
 
-- 
2.9.3



More information about the ffmpeg-devel mailing list