From 2f60d57ab9d5e51c84c34a46ad3d0978e7a388a6 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 23:26:52 +0100 Subject: [PATCH] dtcm: Coverity 88331 and 88169 --- cde/programs/dtcm/dtcm/dtcm_editor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtcm/dtcm/dtcm_editor.c b/cde/programs/dtcm/dtcm/dtcm_editor.c index 4f472092..dcaf43cb 100644 --- a/cde/programs/dtcm/dtcm/dtcm_editor.c +++ b/cde/programs/dtcm/dtcm/dtcm_editor.c @@ -584,8 +584,10 @@ de_apply_proc(Widget w, XtPointer client_data, XtPointer data) { appt->count = old_attr_count; de->modified = False; - if (!str) + if (!str) { + free_appt_struct(&appt); return; + } /* we need to distinguish between whether the data is being saved as part of application termination, or as part of @@ -614,6 +616,8 @@ de_apply_proc(Widget w, XtPointer client_data, XtPointer data) { if (!fp) { XBell(dpy, 50); + free(str); + free_appt_struct(&appt); return; } @@ -638,6 +642,8 @@ de_apply_proc(Widget w, XtPointer client_data, XtPointer data) { if (!fp) { XBell(dpy, 50); + free(str); + free_appt_struct(&appt); return; } -- 2.25.1