mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/http: Fix double-free on error
av_dict_set() with AV_DICT_DONT_STRDUP_VAL takes ownership of the string it is passed to as val; this includes freeing it on error. Fixes Coverity issue #1497468. Reviewed-by: Eran Kornblau <eran.kornblau@kaltura.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
f23d3a5f8f
commit
61cbfdc0a2
|
@ -333,10 +333,8 @@ static int redirect_cache_set(HTTPContext *s, const char *source, const char *de
|
|||
}
|
||||
|
||||
ret = av_dict_set(&s->redirect_cache, source, value, AV_DICT_MATCH_CASE | AV_DICT_DONT_STRDUP_VAL);
|
||||
if (ret < 0) {
|
||||
av_free(value);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue