mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 08:42:39 +00:00
avformat/icecast: Use AV_DICT_DONT_STRDUP_VAL to save an av_strdup
This will probably also fix CID 1452559, a false positive where Coverity claims a double-free occurs, because it thinks that av_dict_set() frees its key and value arguments even when the AV_DICT_DONT_STRDUP_* flags aren't used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Marvin Scholz <epirat07@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
f40fb7963e
commit
15345881e7
@ -114,7 +114,7 @@ static int icecast_open(URLContext *h, const char *uri, int flags)
|
|||||||
// Set options
|
// Set options
|
||||||
av_dict_set(&opt_dict, "method", s->legacy_icecast ? "SOURCE" : "PUT", 0);
|
av_dict_set(&opt_dict, "method", s->legacy_icecast ? "SOURCE" : "PUT", 0);
|
||||||
av_dict_set(&opt_dict, "auth_type", "basic", 0);
|
av_dict_set(&opt_dict, "auth_type", "basic", 0);
|
||||||
av_dict_set(&opt_dict, "headers", headers, 0);
|
av_dict_set(&opt_dict, "headers", headers, AV_DICT_DONT_STRDUP_VAL);
|
||||||
av_dict_set(&opt_dict, "chunked_post", "0", 0);
|
av_dict_set(&opt_dict, "chunked_post", "0", 0);
|
||||||
av_dict_set(&opt_dict, "send_expect_100", s->legacy_icecast ? "-1" : "1", 0);
|
av_dict_set(&opt_dict, "send_expect_100", s->legacy_icecast ? "-1" : "1", 0);
|
||||||
if (NOT_EMPTY(s->content_type))
|
if (NOT_EMPTY(s->content_type))
|
||||||
@ -170,7 +170,6 @@ static int icecast_open(URLContext *h, const char *uri, int flags)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
av_freep(&user);
|
av_freep(&user);
|
||||||
av_freep(&headers);
|
|
||||||
av_dict_free(&opt_dict);
|
av_dict_free(&opt_dict);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user