diff options
author | Yang Tse <yangsita@gmail.com> | 2012-12-26 06:00:59 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-12-26 06:01:54 +0100 |
commit | 219fe7b29c59c29ac34a4c67b4c4032dfac17c10 (patch) | |
tree | 1c43ee82cd6487921310b2b31d1e2ebffead8092 /lib/hash.c | |
parent | d49531dd3a749d43bf3462a58574aaa31adbb27b (diff) | |
download | curl-219fe7b29c59c29ac34a4c67b4c4032dfac17c10.tar.gz |
curl_multi_remove_handle: commit 0aabfd9963 follow-up
Diffstat (limited to 'lib/hash.c')
-rw-r--r-- | lib/hash.c | 13 |
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; + } } } |