alfred: Handle failure during hash iterator allocation
PATCH 1/1 alfred: Handle failure during hash iterator allocation
From: Sven Eckelmann <[email protected]>
The hash_iterate functions should not try to start the iteration when the iterator could not be allocated.
Signed-off-by Sven Eckelmann <[email protected]>
--- hash.c | 3 +++ 1 file changed, 3 insertions(+)
hash.c +3 -0
@@ -116,6 +116,9 @@ struct hash_it_t *hash_iterate(struct hashtable_t *hash,if (!iter_in) { iter =debugMalloc (sizeof (struct hash_it_t ),301 ); +if (!iter) +return NULL ; + iter->index =-1 ; iter->bucket =NULL ; iter->prev_bucket =NULL ;
Signature · 1 line
2.11.0
Simon Wunderlich
AppliedQuoted 5 lines · CET Sven Eckelmann
From: Sven Eckelmann <[email protected]>
The
hash_iteratefunctions should not try to start the iteration when the iterator could not be allocated.
Applied in 4ea6bec
Thank you,
Simon