]> git.sesse.net Git - ffmpeg/commitdiff
avformat/http: fix memleak
authorZhao Zhili <quinkblack@foxmail.com>
Sun, 23 Aug 2020 16:58:09 +0000 (00:58 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 25 Sep 2020 08:21:28 +0000 (10:21 +0200)
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/http.c

index 6c39da1a8b8ab5bcf07d2cb58ef3969181ec80ed..3d25d652d3196a2300271928b894fbddb96b0baf 100644 (file)
@@ -577,7 +577,7 @@ static int http_open(URLContext *h, const char *uri, int flags,
                    "No trailing CRLF found in HTTP header. Adding it.\n");
             ret = av_reallocp(&s->headers, len + 3);
             if (ret < 0)
-                return ret;
+                goto bail_out;
             s->headers[len]     = '\r';
             s->headers[len + 1] = '\n';
             s->headers[len + 2] = '\0';
@@ -588,6 +588,7 @@ static int http_open(URLContext *h, const char *uri, int flags,
         return http_listen(h, uri, flags, options);
     }
     ret = http_open_cnx(h, options);
+bail_out:
     if (ret < 0)
         av_dict_free(&s->chained_options);
     return ret;