From 408d18b711cb2c904817d5c5bb85abd3e861612c Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 03:59:42 +0100 Subject: [PATCH] dtcm: Coverity 88353 --- cde/programs/dtcm/server/delete.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtcm/server/delete.c b/cde/programs/dtcm/server/delete.c index bafeeca2..83e67e40 100644 --- a/cde/programs/dtcm/server/delete.c +++ b/cde/programs/dtcm/server/delete.c @@ -327,7 +327,7 @@ _InSequence(List_node *node, time_t time) { time_t tick; cms_entry *entry = (cms_entry *)node->data; - RepeatEventState *restate; + RepeatEventState *restate = NULL; for (tick = ClosestTick(time, entry->key.time, node->re, &restate); tick <= node->lasttick; @@ -336,10 +336,14 @@ _InSequence(List_node *node, time_t time) if (tick <= 0 || tick > node->lasttick) break; - if (tick == time) + if (tick == time) { + free(restate); return (B_TRUE); + } } + free(restate); + return (B_FALSE); } -- 2.25.1