[Vortex] How to correctly close a connection?

Francis Brosnan Blazquez francis at aspl.es
Fri Oct 17 17:04:56 CEST 2008


Hi Robert,

> > Could it be, that the receiver vortex side now stores some keys and
> data,
> > even an error happend? And when closing the connection tries to
> free  
> > these?
> 
> Digging deeper into the code I found out, that in vortex_sasl.c
> around  
> line 1607 we have this code:
> 
> if (password != NULL) {
> /* RM           vortex_log (LOG_DOMAIN, VORTEX_LEVEL_DEBUG, "digest
> md5 handler  
> defined and password returned from it"); */
>         vortex_log (LOG_DOMAIN, VORTEX_LEVEL_DEBUG, "digest md5
> handler defined  
> and password (%s) returned from it", password);
>         gsasl_property_set (sctx, GSASL_PASSWORD, password);
> 
>         /* Please read the coment done to the
>          * SASL CRAM-MD5 method. The same
>          * applies to this method. */
> 
>         /* configure current digest-md5 validation data
>          * used: authid, and password */
>         vortex_sasl_set_propertie (connection, VORTEX_SASL_AUTH_ID,
>                 (char  *) gsasl_property_get (sctx, GSASL_AUTHID),
> NULL);
>         vortex_sasl_set_propertie (connection,
> VORTEX_SASL_AUTHORIZATION_ID,
>                 (char  *) gsasl_property_get (sctx, GSASL_AUTHZID),
> NULL);
> 
>         vortex_sasl_set_propertie (connection, VORTEX_SASL_REALM,
>                 (char  *) gsasl_property_get (sctx, GSASL_REALM),
> NULL);
> 
>         /* the next instruction store the password duplicating it and
>          * providing a destroy function because the SASL engine
> already
>          * deallocated this value.
>          * deallocate password using axl_free (verified).
>          */
>         vortex_sasl_set_propertie (connection, VORTEX_SASL_PASSWORD,
> /* RM           (char  *) password, axl_free); */
>                 (char  *) password, NULL);
> 
> 
> I made the changes tagged with RM. Compiling vortexlib and it works.
> So  
> the problem has something to do with providing axl_free at this place
> but  
> the pointer seems to be somehow going wild.

This code is right, I mean, it should have a call to axl_free because
the handler configured to return the DIGEST MD5 password must allocate
it. Do do you allocate the string returned by your DIGEST MD5 handler? 

-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.



More information about the Vortex mailing list