diff --git a/libavutil/dict.c b/libavutil/dict.c index 23816e8f55..967c9e2fff 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -98,6 +98,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags if (!newval) return AVERROR(ENOMEM); av_strlcat(newval, oldval, len); + av_freep(&oldval); av_strlcat(newval, value, len); m->elems[m->count].value = newval; } else