From: Ken Raeburn Date: Wed, 6 Aug 2008 16:41:50 +0000 (+0000) Subject: Check for malloc failure X-Git-Tag: krb5-1.7-alpha1~529 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7edd585a6ca521b3f8edefc0b24537227de735b4;p=krb5.git Check for malloc failure git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20615 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/server/schpw.c b/src/kadmin/server/schpw.c index 9e1113a59..76aa2ca85 100644 --- a/src/kadmin/server/schpw.c +++ b/src/kadmin/server/schpw.c @@ -363,6 +363,11 @@ chpwfail: rep->length = 6 + ap_rep.length + cipher.length; rep->data = (char *) malloc(rep->length); + if (rep->data == NULL) { + rep->length = 0; /* checked by caller */ + ret = ENOMEM; + goto bailout; + } ptr = rep->data; /* length */