From 8f2b74aa6d4bae5a3c0ebea59f20766c00854ddf Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 23:43:42 +0100 Subject: [PATCH] dtcm: Coverity 88858 --- cde/programs/dtcm/dtcm/todo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtcm/dtcm/todo.c b/cde/programs/dtcm/dtcm/todo.c index 0cd3c346..ffda2397 100644 --- a/cde/programs/dtcm/dtcm/todo.c +++ b/cde/programs/dtcm/dtcm/todo.c @@ -1982,12 +1982,15 @@ add_to_todo_list(CSA_entry_handle entry, ToDo *t) { if (lines && lines->s) { buf = (char *)ckalloc(cm_strlen(lines->s) + 1); strcpy(buf, lines->s); - destroy_lines(lines); } else { buf = (char *)ckalloc(1); buf[0] = '\0'; } + if(lines) { + destroy_lines(lines); + } + str = XmStringCreateLocalized(buf); XmListAddItem(t->todo_list, str, 0); free_appt_struct(&appt); -- 2.25.1