summaryrefslogtreecommitdiff
path: root/lib/doh.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-10-28 09:28:05 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-10-30 09:36:21 +0100
commitdcd7e37c3a0ce108635b89cacc1e3425e57bd3bc (patch)
tree97213435d44104e4217159001944504ce518158d /lib/doh.c
parent4011802b35638e311e548e8893fa74373275145a (diff)
downloadcurl-dcd7e37c3a0ce108635b89cacc1e3425e57bd3bc.tar.gz
url: make Curl_close() NULLify the pointer too
This is the common pattern used in the code and by a unified approach we avoid mistakes. Closes #4534
Diffstat (limited to 'lib/doh.c')
-rw-r--r--lib/doh.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/doh.c b/lib/doh.c
index 196e89d93..d1795789e 100644
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -346,7 +346,7 @@ static CURLcode dohprobe(struct Curl_easy *data,
error:
free(nurl);
- Curl_close(doh);
+ Curl_close(&doh);
return result;
}
@@ -402,10 +402,8 @@ Curl_addrinfo *Curl_doh(struct connectdata *conn,
error:
curl_slist_free_all(data->req.doh.headers);
data->req.doh.headers = NULL;
- Curl_close(data->req.doh.probe[0].easy);
- data->req.doh.probe[0].easy = NULL;
- Curl_close(data->req.doh.probe[1].easy);
- data->req.doh.probe[1].easy = NULL;
+ Curl_close(&data->req.doh.probe[0].easy);
+ Curl_close(&data->req.doh.probe[1].easy);
return NULL;
}
@@ -925,11 +923,9 @@ CURLcode Curl_doh_is_resolved(struct connectdata *conn,
struct dohentry de;
/* remove DOH handles from multi handle and close them */
curl_multi_remove_handle(data->multi, data->req.doh.probe[0].easy);
- Curl_close(data->req.doh.probe[0].easy);
- data->req.doh.probe[0].easy = NULL;
+ Curl_close(&data->req.doh.probe[0].easy);
curl_multi_remove_handle(data->multi, data->req.doh.probe[1].easy);
- Curl_close(data->req.doh.probe[1].easy);
- data->req.doh.probe[1].easy = NULL;
+ Curl_close(&data->req.doh.probe[1].easy);
/* parse the responses, create the struct and return it! */
init_dohentry(&de);
rc = doh_decode(data->req.doh.probe[0].serverdoh.memory,