summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/hashmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c
index 80fec8fb53..66e9e0046b 100644
--- a/src/basic/hashmap.c
+++ b/src/basic/hashmap.c
@@ -1516,8 +1516,11 @@ void *internal_hashmap_first_key_and_value(HashmapBase *h, bool remove, void **r
unsigned idx;
idx = find_first_entry(h);
- if (idx == IDX_NIL)
+ if (idx == IDX_NIL) {
+ if (ret_key)
+ *ret_key = NULL;
return NULL;
+ }
e = bucket_at(h, idx);
key = (void*) e->key;