lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dear,

there is a strange problem in my C code, as below:

program:

	printf("---%p\n", soap->header);
	soap_header(soap);
	printf("---%p\n", soap->header);

soap_header function:

void soap_header(struct soap *soap)
{
	printf("soap_header enter %p\n", soap->header);
	if(!soap->header)
	{
		printf("soap_header in IF %p\n", soap->header);
		if((soap->header = (struct SOAP_ENV__Header*)soap_malloc(soap,
		        sizeof(struct SOAP_ENV__Header))))
			soap_default_SOAP_ENV__Header(soap, soap->header);
	}
	printf("soap_header exit %p\n", soap->header);
}

The output is :

---(nil)
soap_header enter (nil)
soap_header in IF (nil)
soap_header exit 0xa0d3f80
---(nil)

Who know the reason ? thanks.