From 8620b2e27b5b452007a754fbb3c669941b4d6eb2 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 23:50:31 +0100 Subject: [PATCH] dtcm: Coverity 89021 --- cde/programs/dtcm/libDtCmP/cm_tty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtcm/libDtCmP/cm_tty.c b/cde/programs/dtcm/libDtCmP/cm_tty.c index 77590ed3..588f4e5a 100644 --- a/cde/programs/dtcm/libDtCmP/cm_tty.c +++ b/cde/programs/dtcm/libDtCmP/cm_tty.c @@ -2096,8 +2096,10 @@ appointments_to_file(CSA_session_handle target, CSA_entry_handle *appointment_li if (f_ptr == NULL) return(B_FALSE); - if (num_appts == 0) + if (num_appts == 0) { + fclose(f_ptr); return(B_FALSE); + } fprintf(f_ptr, "DTCM Archive 1.0\n"); for (i = 0; i < num_appts; i++) { -- 2.25.1