dict: fix memleak
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ffd02d0c19
commit
086566a557
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user