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 <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Alexander Bokovoy
2019-11-29 11:14:18 +01:00
committed by Christian Heimes
parent e8b98555fc
commit e3ad78538e
+1
View File
@@ -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;
}
}