* [B.A.T.M.A.N.] [PATCH] alfred: Handle failure during hash iterator allocation
@ 2017-11-23 12:21 Sven Eckelmann
2017-12-01 11:22 ` Simon Wunderlich
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2017-11-23 12:21 UTC (permalink / raw)
To: b.a.t.m.a.n
From: Sven Eckelmann <sven@narfation.org>
The hash_iterate functions should not try to start the iteration when the
iterator could not be allocated.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
hash.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hash.c b/hash.c
index 5a3cdef..116e46f 100644
--- a/hash.c
+++ b/hash.c
@@ -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;
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] alfred: Handle failure during hash iterator allocation
2017-11-23 12:21 [B.A.T.M.A.N.] [PATCH] alfred: Handle failure during hash iterator allocation Sven Eckelmann
@ 2017-12-01 11:22 ` Simon Wunderlich
0 siblings, 0 replies; 2+ messages in thread
From: Simon Wunderlich @ 2017-12-01 11:22 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Sven Eckelmann
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
On Thursday, November 23, 2017 1:21:42 PM CET Sven Eckelmann wrote:
> From: Sven Eckelmann <sven@narfation.org>
>
> The hash_iterate functions should not try to start the iteration when the
> iterator could not be allocated.
>
Applied in 4ea6bec
Thank you,
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-01 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-23 12:21 [B.A.T.M.A.N.] [PATCH] alfred: Handle failure during hash iterator allocation Sven Eckelmann
2017-12-01 11:22 ` Simon Wunderlich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).