Blame 0001-Fix-for-issue-found-by-Coverity.patch

aeef261
From 5da6d34e2659f915e830932fd366c635801ecd91 Mon Sep 17 00:00:00 2001
aeef261
From: Sumit Bose <sbose@redhat.com>
aeef261
Date: Mon, 12 Aug 2019 17:28:20 +0200
aeef261
Subject: [PATCH] Fix for issue found by Coverity
aeef261
aeef261
Related to https://gitlab.freedesktop.org/realmd/adcli/issues/3
aeef261
aeef261
diff --git a/library/adenroll.c b/library/adenroll.c
aeef261
index 53cd812..524663a 100644
aeef261
--- a/library/adenroll.c
aeef261
+++ b/library/adenroll.c
aeef261
@@ -2681,7 +2681,10 @@ adcli_enroll_get_permitted_keytab_enctypes (adcli_enroll *enroll)
aeef261
 	for (c = 0; cur_enctypes[c] != 0; c++);
aeef261
 
aeef261
 	new_enctypes = calloc (c + 1, sizeof (krb5_enctype));
aeef261
-	return_val_if_fail (new_enctypes != NULL, NULL);
aeef261
+	if (new_enctypes == NULL) {
aeef261
+		krb5_free_enctypes (k5, permitted_enctypes);
aeef261
+		return NULL;
aeef261
+	}
aeef261
 
aeef261
 	n = 0;
aeef261
 	for (c = 0; cur_enctypes[c] != 0; c++) {
aeef261
-- 
aeef261
2.21.0
aeef261