summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-05-14 11:03:52 +0200
committerSimo Sorce <ssorce@redhat.com>2008-05-15 12:59:28 -0400
commit3256365277d86c2bb8b693d007dcfa01adae25a8 (patch)
treed305db6e815482cf30bc1096070359afbea188fd
parentd0f0d97be6662c8a2f271aa713b127f0f655fcc4 (diff)
downloadfreeipa.git-3256365277d86c2bb8b693d007dcfa01adae25a8.tar.gz
freeipa.git-3256365277d86c2bb8b693d007dcfa01adae25a8.tar.xz
freeipa.git-3256365277d86c2bb8b693d007dcfa01adae25a8.zip
* ipa_pwd_extop.c (encrypt_encode_key): Handle malloc failure.
-rw-r--r--ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
index dec772c3..24b7df17 100644
--- a/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
+++ b/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
@@ -582,6 +582,11 @@ static Slapi_Value **encrypt_encode_key(krb5_context krbctx, struct ipapwd_data
if (krbTicketFlags & KTF_REQUIRES_PRE_AUTH) {
salt.length = KRB5P_SALT_SIZE;
salt.data = malloc(KRB5P_SALT_SIZE);
+ if (!salt.data) {
+ slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop",
+ "memory allocation failed\n");
+ goto enc_error;
+ }
krberr = krb5_c_random_make_octets(krbctx, &salt);
if (krberr) {
slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop",