summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorRobert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>2021-06-01 18:50:51 +0200
committerTomas Härdin <tjoppen@acc.umu.se>2021-06-26 20:17:57 +0200
commitad06929d8d95542e661a337423f457f5692e6b3b (patch)
tree7edee0d9e1fed26ae9531d825f31b207f0ab852b /libavformat/http.c
parent296dc876ec885cb90f47afaeb30fbe3b94786e1e (diff)
downloadffmpeg-ad06929d8d95542e661a337423f457f5692e6b3b.tar.gz
avformat/http: Stop cookie_dict leaking on errors.
This solves the memory leak reported in https://trac.ffmpeg.org/ticket/9273 Signed-off-by: Robert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 1fc95c768c..476b9a8456 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -605,6 +605,7 @@ static int http_listen(URLContext *h, const char *uri, int flags,
}
fail:
av_dict_free(&s->chained_options);
+ av_dict_free(&s->cookie_dict);
return ret;
}
@@ -645,8 +646,10 @@ static int http_open(URLContext *h, const char *uri, int flags,
}
ret = http_open_cnx(h, options);
bail_out:
- if (ret < 0)
+ if (ret < 0) {
av_dict_free(&s->chained_options);
+ av_dict_free(&s->cookie_dict);
+ }
return ret;
}
@@ -1763,6 +1766,7 @@ static int http_close(URLContext *h)
if (s->hd)
ffurl_closep(&s->hd);
av_dict_free(&s->chained_options);
+ av_dict_free(&s->cookie_dict);
return ret;
}