diff mbox

[FFmpeg-devel,v1,2/2] avformat/libsrt: fix for the memory leak if passphrase has been configured by option

Message ID 20190920111728.5212-2-lance.lmwang@gmail.com
State Accepted
Commit f9d6addd60b3f9ac87388fe4ae0dc217235af81d
Headers show

Commit Message

Lance Wang Sept. 20, 2019, 11:17 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/libsrt.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lance Wang Oct. 11, 2019, 1:01 a.m. UTC | #1
ping the patchset, one is memory leak, one is option type. Please help
to review.

On Fri, Sep 20, 2019 at 07:17:28PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/libsrt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
> index 2fc6328c4e..2105317545 100644
> --- a/libavformat/libsrt.c
> +++ b/libavformat/libsrt.c
> @@ -493,6 +493,7 @@ static int libsrt_open(URLContext *h, const char *uri, int flags)
>              s->pbkeylen = strtol(buf, NULL, 10);
>          }
>          if (av_find_info_tag(buf, sizeof(buf), "passphrase", p)) {
> +            av_freep(&s->passphrase);
>              s->passphrase = av_strndup(buf, strlen(buf));
>          }
>          if (av_find_info_tag(buf, sizeof(buf), "mss", p)) {
> -- 
> 2.21.0
>
Michael Niedermayer Dec. 6, 2019, 9:58 a.m. UTC | #2
On Fri, Sep 20, 2019 at 07:17:28PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/libsrt.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index 2fc6328c4e..2105317545 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -493,6 +493,7 @@  static int libsrt_open(URLContext *h, const char *uri, int flags)
             s->pbkeylen = strtol(buf, NULL, 10);
         }
         if (av_find_info_tag(buf, sizeof(buf), "passphrase", p)) {
+            av_freep(&s->passphrase);
             s->passphrase = av_strndup(buf, strlen(buf));
         }
         if (av_find_info_tag(buf, sizeof(buf), "mss", p)) {