vv=(CONF_VALUE *)lh_insert(ret,(char *)v);
vv=(CONF_VALUE *)lh_insert(ret,v);
LHASH *CONF_load_bio(LHASH *h, BIO *in, long *line)	{	LHASH *ret=NULL;#define BUFSIZE	512	char btmp[16];	int bufnum=0,i,ii;	BUF_MEM *buff=NULL;	char *s,*p,*end;	int again,n;	long eline=0;	CONF_VALUE *v=NULL,*vv,*tv;	CONF_VALUE *sv=NULL;	char *section=NULL,*buf;	STACK_OF(CONF_VALUE) *section_sk=NULL,*ts;	char *start,*psection,*pname;	if ((buff=BUF_MEM_new()) == NULL)		{		CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);		goto err;		}	section=(char *)Malloc(10);	if (section == NULL)		{		CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);		goto err;		}	strcpy(section,"default");	if (h == NULL)		{		if ((ret=lh_new(hash,cmp_conf)) == NULL)			{			CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);			goto err;			}		}	else		ret=h;	sv=new_section(ret,section);	if (sv == NULL)		{		CONFerr(CONF_F_CONF_LOAD_BIO,					CONF_R_UNABLE_TO_CREATE_NEW_SECTION);		goto err;		}	section_sk=(STACK_OF(CONF_VALUE) *)sv->value;	bufnum=0;	for (;;)		{		again=0;		if (!BUF_MEM_grow(buff,bufnum+BUFSIZE))			{			CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);			goto err;			}		p= &(buff->data[bufnum]);		*p='\0';		BIO_gets(in, p, BUFSIZE-1);		p[BUFSIZE-1]='\0';		ii=i=strlen(p);		if (i == 0) break;		while (i > 0)			{			if ((p[i-1] != '\r') && (p[i-1] != '\n'))				break;			else				i--;			}		/* we removed some trailing stuff so there is a new		 * line on the end. */		if (i == ii)			again=1; /* long line */		else			{			p[i]='\0';			eline++; /* another input line */			}		/* we now have a line with trailing \r\n removed */		/* i is the number of bytes */		bufnum+=i;		v=NULL;		/* check for line continuation */		if (bufnum >= 1)			{			/* If we have bytes and the last char '\\' and			 * second last char is not '\\' */			p= &(buff->data[bufnum-1]);			if (	IS_ESC(p[0]) &&				((bufnum <= 1) || !IS_ESC(p[-1])))				{				bufnum--;				again=1;				}			}		if (again) continue;		bufnum=0;		buf=buff->data;		clear_comments(buf);		n=strlen(buf);		s=eat_ws(buf);		if (IS_EOF(*s)) continue; /* blank line */		if (*s == '[')			{			char *ss;			s++;			start=eat_ws(s);			ss=start;again:			end=eat_alpha_numeric(ss);			p=eat_ws(end);			if (*p != ']')				{				if (*p != '\0')					{					ss=p;					goto again;					}				CONFerr(CONF_F_CONF_LOAD_BIO,					CONF_R_MISSING_CLOSE_SQUARE_BRACKET);				goto err;				}			*end='\0';			if (!str_copy(ret,NULL,&section,start)) goto err;			if ((sv=get_section(ret,section)) == NULL)				sv=new_section(ret,section);			if (sv == NULL)				{				CONFerr(CONF_F_CONF_LOAD_BIO,					CONF_R_UNABLE_TO_CREATE_NEW_SECTION);				goto err;				}			section_sk=(STACK_OF(CONF_VALUE) *)sv->value;			continue;			}		else			{			pname=s;			psection=NULL;			end=eat_alpha_numeric(s);			if ((end[0] == ':') && (end[1] == ':'))				{				*end='\0';				end+=2;				psection=pname;				pname=end;				end=eat_alpha_numeric(end);				}			p=eat_ws(end);			if (*p != '=')				{				CONFerr(CONF_F_CONF_LOAD_BIO,						CONF_R_MISSING_EQUAL_SIGN);				goto err;				}			*end='\0';			p++;			start=eat_ws(p);			while (!IS_EOF(*p))				p++;			p--;			while ((p != start) && (IS_WS(*p)))				p--;			p++;			*p='\0';			if (!(v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE))))				{				CONFerr(CONF_F_CONF_LOAD_BIO,							ERR_R_MALLOC_FAILURE);				goto err;				}			if (psection == NULL) psection=section;			v->name=(char *)Malloc(strlen(pname)+1);			v->value=NULL;			if (v->name == NULL)				{				CONFerr(CONF_F_CONF_LOAD_BIO,							ERR_R_MALLOC_FAILURE);				goto err;				}			strcpy(v->name,pname);			if (!str_copy(ret,psection,&(v->value),start)) goto err;			if (strcmp(psection,section) != 0)				{				if ((tv=get_section(ret,psection))					== NULL)					tv=new_section(ret,psection);				if (tv == NULL)					{					CONFerr(CONF_F_CONF_LOAD_BIO,					   CONF_R_UNABLE_TO_CREATE_NEW_SECTION);					goto err;					}				ts=(STACK_OF(CONF_VALUE) *)tv->value;				}			else				{				tv=sv;				ts=section_sk;				}			v->section=tv->section;				if (!sk_CONF_VALUE_push(ts,v))				{				CONFerr(CONF_F_CONF_LOAD_BIO,							ERR_R_MALLOC_FAILURE);				goto err;				}			vv=(CONF_VALUE *)lh_insert(ret,(char *)v);			if (vv != NULL)				{				sk_CONF_VALUE_delete_ptr(ts,vv);				Free(vv->name);				Free(vv->value);				Free(vv);				}			v=NULL;			}		}	if (buff != NULL) BUF_MEM_free(buff);	if (section != NULL) Free(section);	return(ret);err:	if (buff != NULL) BUF_MEM_free(buff);	if (section != NULL) Free(section);	if (line != NULL) *line=eline;	sprintf(btmp,"%ld",eline);	ERR_add_error_data(2,"line ",btmp);	if ((h != ret) && (ret != NULL)) CONF_free(ret);	if (v != NULL)		{		if (v->name != NULL) Free(v->name);		if (v->value != NULL) Free(v->value);		if (v != NULL) Free(v);		}	return(NULL);	}