Commit 086566a5 authored by Michael Niedermayer's avatar Michael Niedermayer

dict: fix memleak

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ffd02d0c
...@@ -98,6 +98,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags ...@@ -98,6 +98,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags
if (!newval) if (!newval)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_strlcat(newval, oldval, len); av_strlcat(newval, oldval, len);
av_freep(&oldval);
av_strlcat(newval, value, len); av_strlcat(newval, value, len);
m->elems[m->count].value = newval; m->elems[m->count].value = newval;
} else } else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment