diff mbox series

[FFmpeg-devel] avformat/http: Stop cookie_dict leaking on errors.

Message ID 20210601165051.13259-1-robert.bengtsson-olund@intinor.se
State Accepted
Commit ad06929d8d95542e661a337423f457f5692e6b3b
Headers show
Series [FFmpeg-devel] avformat/http: Stop cookie_dict leaking on errors. | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Robert Bengtsson-Ölund June 1, 2021, 4:50 p.m. UTC
This solves the memory leak reported in https://trac.ffmpeg.org/ticket/9273

Signed-off-by: Robert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>
---
 libavformat/http.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Steven Liu June 2, 2021, 6:55 a.m. UTC | #1
Robert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>
于2021年6月2日周三 上午1:12写道:
>
> This solves the memory leak reported in https://trac.ffmpeg.org/ticket/9273
>
> Signed-off-by: Robert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>
> ---
>  libavformat/http.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 1fc95c768c..476b9a8456 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -605,6 +605,7 @@ static int http_listen(URLContext *h, const char *uri, int flags,
>      }
>  fail:
>      av_dict_free(&s->chained_options);
> +    av_dict_free(&s->cookie_dict);
>      return ret;
>  }
>
> @@ -645,8 +646,10 @@ static int http_open(URLContext *h, const char *uri, int flags,
>      }
>      ret = http_open_cnx(h, options);
>  bail_out:
> -    if (ret < 0)
> +    if (ret < 0) {
>          av_dict_free(&s->chained_options);
> +        av_dict_free(&s->cookie_dict);
> +    }
>      return ret;
>  }
>
> @@ -1763,6 +1766,7 @@ static int http_close(URLContext *h)
>      if (s->hd)
>          ffurl_closep(&s->hd);
>      av_dict_free(&s->chained_options);
> +    av_dict_free(&s->cookie_dict);
>      return ret;
>  }
>
> --
> 2.27.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

LGTM


Thanks
Steven
Robert Bengtsson-Ölund June 11, 2021, 7:51 a.m. UTC | #2
On Wed, 2 Jun 2021 at 08:55, Steven Liu <lingjiujianke@gmail.com> wrote:
>
> LGTM
>
>
> Thanks
> Steven

Hi everyone

Am I supposed to do something for this to get applied or is it just a
matter of time until someone picks it up?

Best regards
 /Robert
Tomas Härdin June 26, 2021, 7:50 p.m. UTC | #3
fre 2021-06-11 klockan 09:51 +0200 skrev Robert Bengtsson-Ölund:
> On Wed, 2 Jun 2021 at 08:55, Steven Liu <lingjiujianke@gmail.com> wrote:
> > LGTM
> > 
> > 
> > Thanks
> > Steven
> 
> Hi everyone
> 
> Am I supposed to do something for this to get applied or is it just a
> matter of time until someone picks it up?

Passes FATE -> pushed

/Tomas
diff mbox series

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 1fc95c768c..476b9a8456 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -605,6 +605,7 @@  static int http_listen(URLContext *h, const char *uri, int flags,
     }
 fail:
     av_dict_free(&s->chained_options);
+    av_dict_free(&s->cookie_dict);
     return ret;
 }
 
@@ -645,8 +646,10 @@  static int http_open(URLContext *h, const char *uri, int flags,
     }
     ret = http_open_cnx(h, options);
 bail_out:
-    if (ret < 0)
+    if (ret < 0) {
         av_dict_free(&s->chained_options);
+        av_dict_free(&s->cookie_dict);
+    }
     return ret;
 }
 
@@ -1763,6 +1766,7 @@  static int http_close(URLContext *h)
     if (s->hd)
         ffurl_closep(&s->hd);
     av_dict_free(&s->chained_options);
+    av_dict_free(&s->cookie_dict);
     return ret;
 }