diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2017-12-30 15:42:13 +0300 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2017-12-31 21:43:54 +0300 |
commit | 2906363d1bb804994cf741ad2c99d8c76efff5f0 (patch) | |
tree | bb4af620f248fd325ab74abd2d35b5f7d449f74e | |
parent | f3552c3b9d517e278ec45d5e2bd53bf3e7dc754b (diff) |
avformat/hls: release mem resource to fix memleak
fix CID: 1426991
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavformat/hls.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index d9f7c6de4d..950cc4c3bd 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1473,8 +1473,11 @@ reload: if (c->http_multiple == -1) { uint8_t *http_version_opt = NULL; - av_opt_get(v->input, "http_version", AV_OPT_SEARCH_CHILDREN, &http_version_opt); - c->http_multiple = http_version_opt && strncmp((const char *)http_version_opt, "1.1", 3) == 0; + int r = av_opt_get(v->input, "http_version", AV_OPT_SEARCH_CHILDREN, &http_version_opt); + if (r >= 0) { + c->http_multiple = strncmp((const char *)http_version_opt, "1.1", 3) == 0; + av_freep(&http_version_opt); + } } seg = next_segment(v); |