axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Florian Steinborn" <florian.steinb...@drb.insel.de>
Subject [AXIS2C] memory management
Date Mon, 18 Jun 2007 13:17:08 GMT
Hi friends,

just a "simple" question...
When you define a webservice that has an operation that returns a string,  
you probably will get a generated function similiar to this:

/* starts here */

axis2_getStringResponse_t*
axis2_skel_<servicename>_getString ( const axutil_env_t *env  ,
                                 axis2_getString_t* getString )
{
     axis2_getStringResponse_t*  getStringRes = NULL;
     axis2_char_t*               retVal = NULL ;

     retVal = (axis2_char_t*) malloc( sizeof(char) * 20);
     strncpy( retVal, "NONSENS", 20);



     getStringRes = axis2_getStringResponse_create( env);
     axis2_getStringResponse_set_return( getStringRes, env, retVal) ;

     return getStringRes;

}

/* ends here */

The big question is: who cares for the memory allocated in "retVal" ? Do I  
have to free it or is it freed automatically by the Axis2 machine after  
serializing the answer? A small string may not be interesting but when you  
have to fill structs or arrays of structs... ?

Thanks,

Flori

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Mime
View raw message