dtcm: Coverity 88353
authorPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 02:59:42 +0000 (03:59 +0100)
committerPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 02:59:42 +0000 (03:59 +0100)
cde/programs/dtcm/server/delete.c

index bafeeca237235cf2ab3e5f4d6a26b6221fd72beb..83e67e40c540a0f7281af31847266d0936a6220c 100644 (file)
@@ -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);
 }