From 29dabbd900c9467ff28592120052626ca99978ac Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Wed, 4 Jul 2018 23:58:03 +0100 Subject: [PATCH] dtcm: Coverity 89439 and 89458 --- cde/programs/dtcm/libDtCmP/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtcm/libDtCmP/util.c b/cde/programs/dtcm/libDtCmP/util.c index a0a65936..d33b8ba1 100644 --- a/cde/programs/dtcm/libDtCmP/util.c +++ b/cde/programs/dtcm/libDtCmP/util.c @@ -872,8 +872,11 @@ same_user(char *user1, char *user2) str1 = get_head(user1, '@'); str2 = get_head(user2, '@'); - if (str1 == NULL || str2 == NULL) + if (str1 == NULL || str2 == NULL) { + free(str1); + free(str2); /* Handle if only one alloc success */ return(B_FALSE); + } if (strcmp(str1, str2)) { free(str1); -- 2.25.1