diff options
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; + } } } |