From 19d0bafaad144851e5cc63412998a5401e9603c0 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 20:14:18 +0100 Subject: [PATCH] dtcm: Coverity 89169 --- cde/programs/dtcm/server/parser.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cde/programs/dtcm/server/parser.y b/cde/programs/dtcm/server/parser.y index a89ff0eb..1095f2de 100644 --- a/cde/programs/dtcm/server/parser.y +++ b/cde/programs/dtcm/server/parser.y @@ -1080,7 +1080,7 @@ static CSA_return_code get_date_time_list_value(char *valstr, cms_attribute_value **attrval) { char *ptr; - CSA_date_time_entry *a, *head, *prev; + CSA_date_time_entry *a = NULL, *head, *prev; CSA_return_code stat = CSA_SUCCESS; cms_attribute_value *val; @@ -1123,8 +1123,10 @@ get_date_time_list_value(char *valstr, cms_attribute_value **attrval) head = a; else prev->next = a; - } else + } else { + free(a); stat = CSA_E_INSUFFICIENT_MEMORY; + } } if (stat == CSA_SUCCESS) { -- 2.25.1