diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-06-20 23:00:36 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-06-21 09:44:04 +0200 |
commit | 2c15693a3c355d8296a1828123a864397296460b (patch) | |
tree | 4c63ede95b6ad7ee2924464ba5a27a5314c55736 /lib/conncache.c | |
parent | dfb873e308eb19ee31064bb2a398f7da7b58873c (diff) | |
download | curl-2c15693a3c355d8296a1828123a864397296460b.tar.gz |
url: fix dangling conn->data pointer
By masking sure to use the *current* easy handle with extracted
connections from the cache, and make sure to NULLify the ->data pointer
when the connection is put into the cache to make this mistake easier to
detect in the future.
Reported-by: Will Dietz
Fixes #2669
Closes #2672
Diffstat (limited to 'lib/conncache.c')
-rw-r--r-- | lib/conncache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/conncache.c b/lib/conncache.c index 6bd06582a..066542915 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -6,7 +6,7 @@ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2016, Linus Nielsen Feltzing, <linus@haxx.se> - * Copyright (C) 2012 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2012 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -451,6 +451,7 @@ bool Curl_conncache_return_conn(struct connectdata *conn) } CONN_LOCK(data); conn->inuse = FALSE; /* Mark the connection unused */ + conn->data = NULL; /* no owner */ CONN_UNLOCK(data); return (conn_candidate == conn) ? FALSE : TRUE; |