Fix some resource leaks identified by a static analyzer

Fixes: https://pagure.io/freeipa/issue/9367

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Francisco Trivino <ftrivino@redhat.com>
This commit is contained in:
Rob Crittenden
2024-04-10 10:15:55 -04:00
committed by Florence Blanc-Renaud
parent d0684a7ecf
commit 21c6ccc982
6 changed files with 29 additions and 8 deletions

View File

@@ -904,6 +904,7 @@ static int prep_ksdata(krb5_context krbctx, const char *str,
ksdata = calloc(n + 1, sizeof(struct krb_key_salt));
if (NULL == ksdata) {
*err_msg = _("Out of memory!?\n");
ipa_krb5_free_ktypes(krbctx, ktypes);
return 0;
}