summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-01 14:48:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-01 14:48:17 +0200
commitf218121a4d79f9aab45526f3d1655ec2cc8de0d1 (patch)
tree9b945e589bee2fd6309ecbdf8526ac73a03aeae1 /libavformat/http.c
parentedf96d631c000d1810be42649891bfddb9754427 (diff)
http: use ffurl_closep()
Fixes Ticket1383 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index a06946482e..a30312905d 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -163,7 +163,8 @@ static int http_open_cnx(URLContext *h)
if (s->http_code == 401) {
if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
- ffurl_close(hd);
+ ffurl_closep(&hd);
+ s->hd = NULL;
goto redo;
} else
goto fail;
@@ -171,7 +172,8 @@ static int http_open_cnx(URLContext *h)
if (s->http_code == 407) {
if ((cur_proxy_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
- ffurl_close(hd);
+ ffurl_closep(&hd);
+ s->hd = NULL;
goto redo;
} else
goto fail;
@@ -179,7 +181,8 @@ static int http_open_cnx(URLContext *h)
if ((s->http_code == 301 || s->http_code == 302 || s->http_code == 303 || s->http_code == 307)
&& location_changed == 1) {
/* url moved, get next */
- ffurl_close(hd);
+ ffurl_closep(&hd);
+ s->hd = NULL;
if (redirects++ >= MAX_REDIRECTS)
return AVERROR(EIO);
/* Restart the authentication process with the new target, which
@@ -192,7 +195,7 @@ static int http_open_cnx(URLContext *h)
return 0;
fail:
if (hd)
- ffurl_close(hd);
+ ffurl_closep(&hd);
s->hd = NULL;
return AVERROR(EIO);
}
@@ -602,7 +605,7 @@ static int http_close(URLContext *h)
}
if (s->hd)
- ffurl_close(s->hd);
+ ffurl_closep(&s->hd);
return ret;
}
@@ -684,7 +687,7 @@ static int http_proxy_close(URLContext *h)
{
HTTPContext *s = h->priv_data;
if (s->hd)
- ffurl_close(s->hd);
+ ffurl_closep(&s->hd);
return 0;
}
@@ -755,8 +758,7 @@ redo:
if (s->http_code == 407 &&
(cur_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 2) {
- ffurl_close(s->hd);
- s->hd = NULL;
+ ffurl_closep(&s->hd);
goto redo;
}