Ensure this is even the case if they are empty because we failed adding the first entry.
Signed-off-by: Reimar Döffinger <reimar.doeffin...@gmx.de> --- libavutil/dict.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavutil/dict.c b/libavutil/dict.c index f23b768..bdb5690 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -122,6 +122,10 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, return 0; err_out: + if (!m->count) { + av_free(m->elems); + av_freep(pm); + } if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key); if (flags & AV_DICT_DONT_STRDUP_VAL) av_free(value); return AVERROR(ENOMEM); -- 2.1.0.rc1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel