of realloc(NULL) returning NULL
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4032
dc483132-0cff-0310-8789-
dd5450dbe970
+Tue Aug 2 07:22:57 1994 Tom Yu (tlyu@dragons-lair)
+
+ * asn1_decode_k.c (asn1_decode_sequence_of_enctype): more fixing
+ of realloc(NULL) returning NULL
+
Sat Jul 23 08:48:18 1994 Tom Yu (tlyu@dragons-lair)
* asn1buf.h: include ext-proto.h now to avoid type warnings
{ sequence_of(buf);
while(asn1buf_remains(&seqbuf) > 0){
size++;
- *val = (krb5_enctype*)realloc(*val,size*sizeof(krb5_enctype));
+ if (*val == NULL)
+ *val = (krb5_enctype*)malloc(*val,size*sizeof(krb5_enctype));
+ else
+ *val = (krb5_enctype*)realloc(*val,size*sizeof(krb5_enctype));
if(*val == NULL) return ENOMEM;
retval = asn1_decode_enctype(&seqbuf,&((*val)[size-1]));
if(retval) return retval;