Check for malloc failure
authorKen Raeburn <raeburn@mit.edu>
Wed, 6 Aug 2008 16:41:50 +0000 (16:41 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 6 Aug 2008 16:41:50 +0000 (16:41 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20615 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/server/schpw.c

index 9e1113a5920ce1310807ca449ee9e01a101d524b..76aa2ca8525643f0e71f40d54a5241178bc2e9fa 100644 (file)
@@ -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 */