From 294330896d1ad26c10eecf6c3bf20d73b5ec624b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 27 Oct 2014 23:50:51 +0100 Subject: [PATCH] journald: be nice to coverity, add an extra assert coverity otherwise assumes that the chain object might be NULL. --- src/journal/journal-file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index d06dbc2..8a2c0fc 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1380,9 +1380,10 @@ static void chain_cache_put( if (array == first) return; - if (ordered_hashmap_size(h) >= CHAIN_CACHE_MAX) + if (ordered_hashmap_size(h) >= CHAIN_CACHE_MAX) { ci = ordered_hashmap_steal_first(h); - else { + assert(ci); + } else { ci = new(ChainCacheItem, 1); if (!ci) return; -- 2.7.4