if ((x != NULL) && (*x == NULL))
if (*x == NULL)
STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,					 X509_EXTENSION *ex, int loc)	{	X509_EXTENSION *new_ex=NULL;	int n;	STACK_OF(X509_EXTENSION) *sk=NULL;	if ((x != NULL) && (*x == NULL))		{		if ((sk=sk_X509_EXTENSION_new_null()) == NULL)			goto err;		}	else		sk= *x;	n=sk_X509_EXTENSION_num(sk);	if (loc > n) loc=n;	else if (loc < 0) loc=n;	if ((new_ex=X509_EXTENSION_dup(ex)) == NULL)		goto err2;	if (!sk_X509_EXTENSION_insert(sk,new_ex,loc))		goto err;	if ((x != NULL) && (*x == NULL))		*x=sk;	return(sk);err:	X509err(X509_F_X509V3_ADD_EXT,ERR_R_MALLOC_FAILURE);err2:	if (new_ex != NULL) X509_EXTENSION_free(new_ex);	if (sk != NULL) sk_X509_EXTENSION_free(sk);	return(NULL);	}