diff mbox

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

Message ID 20180112181630.22533-1-klaxa1337@googlemail.com
State Accepted
Commit 7b6b8c92652d6683d97515352e4a9a4147b7da7c
Headers show

Commit Message

Stephan Holljes Jan. 12, 2018, 6:16 p.m. UTC
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
---
 libavformat/http.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stephan Holljes April 19, 2018, 8:08 p.m. UTC | #1
On Fri, Jan 12, 2018 at 7:16 PM, Stephan Holljes
<klaxa1337@googlemail.com> wrote:
> Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
> ---
>  libavformat/http.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 4806b1e59b..537d0a4773 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -574,7 +574,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_closep(c);
> +    }
>      return ret;
>  }
>
> --
> 2.15.1
>

Maybe it was not apparent (I'm not too organized with email), but this
patch was sent along with the tcp patch . It was also discussed in
this thread: https://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/210024.html

Thanks!
Michael Niedermayer April 19, 2018, 11:47 p.m. UTC | #2
On Thu, Apr 19, 2018 at 10:08:25PM +0200, Stephan Holljes wrote:
> On Fri, Jan 12, 2018 at 7:16 PM, Stephan Holljes
> <klaxa1337@googlemail.com> wrote:
> > Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
> > ---
> >  libavformat/http.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/libavformat/http.c b/libavformat/http.c
> > index 4806b1e59b..537d0a4773 100644
> > --- a/libavformat/http.c
> > +++ b/libavformat/http.c
> > @@ -574,7 +574,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_closep(c);
> > +    }
> >      return ret;
> >  }
> >
> > --
> > 2.15.1
> >
> 
> Maybe it was not apparent (I'm not too organized with email), but this
> patch was sent along with the tcp patch . It was also discussed in
> this thread: https://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/210024.html

Ill apply it but we need a maintainer for http so these things move at a
more acceptable pace

thx

[...]
diff mbox

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 4806b1e59b..537d0a4773 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -574,7 +574,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_closep(c);
+    }
     return ret;
 }