Commit 375fa061 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '1619274f'

* commit '1619274f':
  av_dict_set: fix potential memory leak with AV_DICT_DONT_OVERWRITE
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 383d8ddf 1619274f
......@@ -76,8 +76,11 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
m = *pm = av_mallocz(sizeof(*m));
if (tag) {
if (flags & AV_DICT_DONT_OVERWRITE)
if (flags & AV_DICT_DONT_OVERWRITE) {
if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key);
if (flags & AV_DICT_DONT_STRDUP_VAL) av_free(value);
return 0;
}
if (flags & AV_DICT_APPEND)
oldval = tag->value;
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