1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 01:55:32 +03:00

Merge pull request #11647 from thom311/hashmap-avoid-compiler-warning

Hashmap avoid compiler warning
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-02-08 18:25:23 +01:00 committed by GitHub
commit 9ef55e8b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -888,7 +888,8 @@ void internal_hashmap_clear(HashmapBase *h, free_func_t default_free_key, free_f
* themselves from our hash table a second time, the entry is already gone. */
while (internal_hashmap_size(h) > 0) {
void *v, *k;
void *k = NULL;
void *v;
v = internal_hashmap_first_key_and_value(h, true, &k);
@ -1515,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;