malloc. [krb5-libs/518]
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10345
dc483132-0cff-0310-8789-
dd5450dbe970
+Fri Jan 2 21:18:30 1998 Tom Yu <tlyu@mit.edu>
+
+ * asn1buf.c (asn12krb5_buf): Check return value of
+ malloc. [krb5-libs/518]
+
Tue Sep 30 19:03:34 1997 Tom Yu <tlyu@mit.edu>
* krbasn1.h: Replace HAS_STDLIB_H with something more sane.
(*code)->length = 0;
(*code)->length = asn1buf_len(buf);
(*code)->data = (char*)malloc((((*code)->length)+1)*sizeof(char));
+ if ((*code)->data == NULL) {
+ free(*code);
+ return ENOMEM;
+ }
for(i=0; i < (*code)->length; i++)
((*code)->data)[i] = (buf->base)[((*code)->length)-i-1];
((*code)->data)[(*code)->length] = '\0';