if (!BUF_MEM_grow(&b,num+os->length))
if (!BUF_MEM_grow_clean(&b,num+os->length))
static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)	{	ASN1_STRING *os=NULL;	BUF_MEM b;	int num;	b.length=0;	b.max=0;	b.data=NULL;	if (a == NULL)		{		c->error=ERR_R_PASSED_NULL_PARAMETER;		goto err;		}	num=0;	for (;;)		{		if (c->inf & 1)			{			c->eos=ASN1_check_infinite_end(&c->p,				(long)(c->max-c->p));			if (c->eos) break;			}		else			{			if (c->slen <= 0) break;			}		c->q=c->p;		if (d2i_ASN1_bytes(&os,&c->p,c->max-c->p,c->tag,c->xclass)			== NULL)			{			c->error=ERR_R_ASN1_LIB;			goto err;			}		if (!BUF_MEM_grow(&b,num+os->length))			{			c->error=ERR_R_BUF_LIB;			goto err;			}		memcpy(&(b.data[num]),os->data,os->length);		if (!(c->inf & 1))			c->slen-=(c->p-c->q);		num+=os->length;		}	if (!asn1_Finish(c)) goto err;	a->length=num;	if (a->data != NULL) OPENSSL_free(a->data);	a->data=(unsigned char *)b.data;	if (os != NULL) ASN1_STRING_free(os);	return(1);err:	ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE,c->error);	if (os != NULL) ASN1_STRING_free(os);	if (b.data != NULL) OPENSSL_free(b.data);	return(0);	}