[FFmpeg-devel] [PATCH V1 04/12] lavc/libvpxenc: fix memory leak after av_dict_parse_string fail
Jun Zhao
mypopydev at gmail.com
Wed Jan 1 07:20:32 EET 2020
From: Jun Zhao <barryjzhao at 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 at tencent.com>
---
libavcodec/libvpxenc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 721a052..e9b3793 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -768,9 +768,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
"Error parsing option '%s = %s'.\n",
en->key, en->value);
}
-
- av_dict_free(&dict);
}
+ av_dict_free(&dict);
}
dump_enc_cfg(avctx, &enccfg);
--
1.7.1
More information about the ffmpeg-devel
mailing list