diff mbox series

[FFmpeg-devel,V1,07/12] lavc/libxavs2: fix memory leak after av_dict_parse_string fail

Message ID 1577856040-17409-7-git-send-email-mypopydev@gmail.com
State New
Headers show
Series [FFmpeg-devel,V1,01/12] lavc/bsf: fix memory leak after av_dict_parse_string fail
Related show


Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork fail Failed to apply patch

Commit Message

Jun Zhao Jan. 1, 2020, 5:20 a.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
 libavcodec/libxavs2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox series


diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index 2f8460a..91afeeb 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -100,8 +100,8 @@  static av_cold int xavs2_init(AVCodecContext *avctx)
             while ((en = av_dict_get(dict, "", en, AV_DICT_IGNORE_SUFFIX))) {
                 xavs2_opt_set2(en->key, "%s", en->value);
-            av_dict_free(&dict);
+        av_dict_free(&dict);
     /* Rate control */