From e3ad78538e1dd2f63f171ef1c2b470a1a4f47a8c Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 28 Nov 2019 17:48:18 +0200 Subject: [PATCH] covscan: free encryption types in case there is an error Even when a number of translated encryption types is zero, the array might still be allocated. Call free() in any case as free(NULL) does nothing. Fixes: https://pagure.io/freeipa/issue/8131 Signed-off-by: Alexander Bokovoy Reviewed-By: Florence Blanc-Renaud --- client/ipa-getkeytab.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ipa-getkeytab.c b/client/ipa-getkeytab.c index 2501f8e4a..69fe9dbf0 100644 --- a/client/ipa-getkeytab.c +++ b/client/ipa-getkeytab.c @@ -512,6 +512,7 @@ static int ldap_get_keytab(krb5_context krbctx, bool generate, char *password, if (enctypes) { ret = ipa_string_to_enctypes(enctypes, &es, &num_es, err_msg); if (ret || num_es == 0) { + free(es); return LDAP_OPERATIONS_ERROR; } }