summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-27 23:50:51 +0100
committerLennart Poettering <lennart@poettering.net>2014-10-27 23:50:53 +0100
commit294330896d1ad26c10eecf6c3bf20d73b5ec624b (patch)
treeadca48442215686c30efb5cea4ae496c5280196e
parent7f8bf08f9036de419ad14c55b61eda74c6659d3a (diff)
journald: be nice to coverity, add an extra assert
coverity otherwise assumes that the chain object might be NULL.
-rw-r--r--src/journal/journal-file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index d06dbc2f75..8a2c0fcac5 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;