dtcm: Coverity 88468
authorPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 18:43:09 +0000 (19:43 +0100)
committerPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 18:43:09 +0000 (19:43 +0100)
cde/programs/dtcm/server/reminder.c

index d1de38de985843f4ed7745372b53d9153b890ed3..ac48232cb71dfc28d300b0fe34ea36b76c31a8e9 100644 (file)
@@ -807,7 +807,7 @@ _UpdateReminderQ(_DtCmsRemQueue *remq, int qindex)
        _DtCmsRemInfo   *rptr, *nptr;
        cms_entry       *entry;
        time_t          lead, tick;
-       RepeatEventState *restate;
+       RepeatEventState *restate = NULL;
 
        for (; (rptr = remq->active[qindex]) != NULL &&
            rptr->runtime < remq->cutoff; ) {
@@ -824,6 +824,8 @@ _UpdateReminderQ(_DtCmsRemQueue *remq, int qindex)
                        tick = ClosestTick(entry->key.time, entry->key.time,
                                rptr->lnode->re, &restate);
 
+                       free(restate);
+
                        if (tick == rptr->starttime) {
                                /* add this to old queue */
                                _InsertReminder(&remq->oldhead[qindex], rptr);