From: Peter Howkins Date: Fri, 13 Jul 2018 18:04:37 +0000 (+0100) Subject: dtcm: Coverity 89685 X-Git-Tag: 2.3.0a~71 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9e038c8b2b5863ec9273e4316502a320abb6ef6a;p=oweals%2Fcde.git dtcm: Coverity 89685 --- diff --git a/cde/programs/dtcm/dtcm/dnd.c b/cde/programs/dtcm/dtcm/dnd.c index 0615efae..abc58c12 100644 --- a/cde/programs/dtcm/dtcm/dnd.c +++ b/cde/programs/dtcm/dtcm/dnd.c @@ -521,7 +521,7 @@ CSA_entry_handle get_appt_struct(DragContext *context) { int *item_list = NULL, item_cnt = 0, answer; char buf[MAXNAMELEN]; - Widget list; + Widget list = NULL; Calendar *c = context->calendar; Props_pu *pr; CSA_entry_handle entry = 0; @@ -536,7 +536,7 @@ get_appt_struct(DragContext *context) { else if (context->editor_type == TodoEditorList) list = ((ToDo *) context->editor)->todo_list; - if (!XmListGetSelectedPos(list, &item_list, &item_cnt)) { + if (list && !XmListGetSelectedPos(list, &item_list, &item_cnt)) { char *title = XtNewString(catgets(c->DT_catd, 1, 230, "Calendar : Error - Drag Appointment")); char *text = XtNewString(catgets(c->DT_catd, 1, 231, "Select an appointment and DRAG again."));