From cf9c9a9db93ac5158ad77ba7f6d23493d7e8e222 Mon Sep 17 00:00:00 2001 From: Jun Zhao Date: Wed, 1 Jan 2020 12:09:52 +0800 Subject: [PATCH] lavc/libkvazaar: fix memory leak after av_dict_parse_string fail 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 --- libavcodec/libkvazaar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c index a89ca7f749..02bcae3d5c 100644 --- a/libavcodec/libkvazaar.c +++ b/libavcodec/libkvazaar.c @@ -110,8 +110,8 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx) entry->key, entry->value); } } - av_dict_free(&dict); } + av_dict_free(&dict); } ctx->encoder = enc = api->encoder_open(cfg);