summaryrefslogtreecommitdiff
path: root/lib/hash.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-12-26 06:00:59 +0100
committerYang Tse <yangsita@gmail.com>2012-12-26 06:01:54 +0100
commit219fe7b29c59c29ac34a4c67b4c4032dfac17c10 (patch)
tree1c43ee82cd6487921310b2b31d1e2ebffead8092 /lib/hash.c
parentd49531dd3a749d43bf3462a58574aaa31adbb27b (diff)
downloadcurl-219fe7b29c59c29ac34a4c67b4c4032dfac17c10.tar.gz
curl_multi_remove_handle: commit 0aabfd9963 follow-up
Diffstat (limited to 'lib/hash.c')
-rw-r--r--lib/hash.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/hash.c b/lib/hash.c
index 32c1d0463..b59e56146 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -208,12 +208,15 @@ Curl_hash_pick(struct curl_hash *h, void *key, size_t key_len)
{
struct curl_llist_element *le;
struct curl_hash_element *he;
- struct curl_llist *l = FETCH_LIST(h, key, key_len);
+ struct curl_llist *l;
- for(le = l->head; le; le = le->next) {
- he = le->ptr;
- if(h->comp_func(he->key, he->key_len, key, key_len)) {
- return he->ptr;
+ if(h) {
+ l = FETCH_LIST(h, key, key_len);
+ for(le = l->head; le; le = le->next) {
+ he = le->ptr;
+ if(h->comp_func(he->key, he->key_len, key, key_len)) {
+ return he->ptr;
+ }
}
}