if ((a == NULL) || ((*a) == NULL) || !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) { if ((ret=ASN1_OBJECT_new()) == NULL) return(NULL); } else	ret=(*a);
ASN1_OBJECT *ret = NULL;
ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,	     long length)	{	ASN1_OBJECT *ret=NULL;	unsigned char *p;	long len;	int tag,xclass;	int inf,i;	/* only the ASN1_OBJECTs from the 'table' will have values	 * for ->sn or ->ln */	if ((a == NULL) || ((*a) == NULL) ||		!((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC))		{		if ((ret=ASN1_OBJECT_new()) == NULL) return(NULL);		}	else	ret=(*a);	p= *pp;	inf=ASN1_get_object(&p,&len,&tag,&xclass,length);	if (inf & 0x80)		{		i=ASN1_R_BAD_OBJECT_HEADER;		goto err;		}	if (tag != V_ASN1_OBJECT)		{		i=ASN1_R_EXPECTING_AN_OBJECT;		goto err;		}	if ((ret->data == NULL) || (ret->length < len))		{		if (ret->data != NULL) OPENSSL_free(ret->data);		ret->data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1);		ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;		if (ret->data == NULL)			{ i=ERR_R_MALLOC_FAILURE; goto err; }		}	memcpy(ret->data,p,(int)len);	ret->length=(int)len;	ret->sn=NULL;	ret->ln=NULL;	/* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */	p+=len;	if (a != NULL) (*a)=ret;	*pp=p;	return(ret);err:	ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);	if ((ret != NULL) && ((a == NULL) || (*a != ret)))		ASN1_OBJECT_free(ret);	return(NULL);	}