diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-13 20:57:05 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-14 19:00:44 +0200 |
commit | c15dd31d2a9067b3aa7a575f585f44d62e9d5454 (patch) | |
tree | 677506bc72870e99145bf42f37951490971eda8b /libavformat/rtpdec_h264.c | |
parent | f976ed7fcf61324451e73876840c9473125f371b (diff) | |
download | ffmpeg-c15dd31d2a9067b3aa7a575f585f44d62e9d5454.tar.gz |
avutil/dict: Fix memleak when using AV_DICT_APPEND
If a key already exists in an AVDictionary and the AV_DICT_APPEND flag
is set, the old entry is at first discarded from the dictionary, but
a pointer to the value is kept. Lateron enough memory to store the
appended string is allocated; should this allocation fail, the old string
is not freed and hence leaks. This commit changes this by moving
creating the combined value to an earlier point in the function,
which also ensures that the AVDictionary is unchanged in case of errors.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/rtpdec_h264.c')
0 files changed, 0 insertions, 0 deletions