Blob Blame History Raw
From d0f047e12c2c84ac9b5d98834bfa83c69987d681 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jcholast@redhat.com>
Date: Mon, 10 Nov 2014 18:12:52 +0000
Subject: [PATCH] Fix unchecked return value in krb5 common utils

https://fedorahosted.org/freeipa/ticket/4713

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
---
 util/ipa_krb5.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/util/ipa_krb5.c b/util/ipa_krb5.c
index 6334ed3b09b91a79648a16c0fd60dd6ff00d2fa2..feb23eae9099b83b96a26cf36b7cbc31b478c4f6 100644
--- a/util/ipa_krb5.c
+++ b/util/ipa_krb5.c
@@ -730,6 +730,10 @@ struct berval *create_key_control(struct keys_container *keys,
 
         if (ksdata[i].salttype == NO_SALT) {
             ret = ber_printf(be, "}");
+            if (ret == -1) {
+                ber_free(be, 1);
+                return NULL;
+            }
             continue;
         }
 
-- 
2.1.0