ENGINE_cleanup();
int main(int Argc, char *Argv[])	{	ARGS arg;#define PROG_NAME_SIZE	16	char pname[PROG_NAME_SIZE];	FUNCTION f,*fp;	MS_STATIC char *prompt,buf[1024],config_name[256];	int n,i,ret=0;	int argc;	char **argv,*p;	LHASH *prog=NULL;	long errline; 	arg.data=NULL;	arg.count=0;	if (getenv("OPENSSL_DEBUG_MEMORY") != NULL) /* if not defined, use compiled-in library defaults */		{		if (!(0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))			{			CRYPTO_malloc_debug_init();			CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);			}		else			{			/* OPENSSL_DEBUG_MEMORY=off */			CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);			}		}	CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);#if 0	if (getenv("OPENSSL_DEBUG_LOCKING") != NULL)#endif		{		CRYPTO_set_locking_callback(lock_dbg_cb);		}	apps_startup();	if (bio_err == NULL)		if ((bio_err=BIO_new(BIO_s_file())) != NULL)			BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);	ERR_load_crypto_strings();	ENGINE_load_builtin_engines();	/* Lets load up our environment a little */	p=getenv("OPENSSL_CONF");	if (p == NULL)		p=getenv("SSLEAY_CONF");	if (p == NULL)		{		strcpy(config_name,X509_get_default_cert_area());#ifndef OPENSSL_SYS_VMS		strcat(config_name,"/");#endif		strcat(config_name,OPENSSL_CONF);		p=config_name;		}	default_config_file=p;	config=NCONF_new(NULL);	i=NCONF_load(config,p,&errline);	if (i == 0) ERR_clear_error();	prog=prog_init();	/* first check the program name */	program_name(Argv[0],pname,PROG_NAME_SIZE);	f.name=pname;	fp=(FUNCTION *)lh_retrieve(prog,&f);	if (fp != NULL)		{		Argv[0]=pname;		ret=fp->func(Argc,Argv);		goto end;		}	/* ok, now check that there are not arguments, if there are,	 * run with them, shifting the ssleay off the front */	if (Argc != 1)		{		Argc--;		Argv++;		ret=do_cmd(prog,Argc,Argv);		if (ret < 0) ret=0;		goto end;		}	/* ok, lets enter the old 'OpenSSL>' mode */		for (;;)		{		ret=0;		p=buf;		n=1024;		i=0;		for (;;)			{			p[0]='\0';			if (i++)				prompt=">";			else	prompt="OpenSSL> ";			fputs(prompt,stdout);			fflush(stdout);			fgets(p,n,stdin);			if (p[0] == '\0') goto end;			i=strlen(p);			if (i <= 1) break;			if (p[i-2] != '\\') break;			i-=2;			p+=i;			n-=i;			}		if (!chopup_args(&arg,buf,&argc,&argv)) break;		ret=do_cmd(prog,argc,argv);		if (ret < 0)			{			ret=0;			goto end;			}		if (ret != 0)			BIO_printf(bio_err,"error in %s\n",argv[0]);		(void)BIO_flush(bio_err);		}	BIO_printf(bio_err,"bad exit\n");	ret=1;end:	if (config != NULL)		{		NCONF_free(config);		config=NULL;		}	if (prog != NULL) lh_free(prog);	if (arg.data != NULL) OPENSSL_free(arg.data);	ERR_remove_state(0);	EVP_cleanup();	ERR_free_strings();	        ENGINE_cleanup();	apps_shutdown();	CRYPTO_mem_leaks(bio_err);	if (bio_err != NULL)		{		BIO_free(bio_err);		bio_err=NULL;		}	EXIT(ret);	}