On 8/22/06, Karl Fogel <kfogel@google.com> wrote:
> This strikes me as weird, but perhaps I'm worried about nothing:
>
> The parameter 'sasl_ctx' comes into new_sasl_ctx() as:
>
> sasl_conn_t **sasl_ctx
>
> We register it for cleanup with a single dereferencing:
>
> apr_pool_cleanup_register(pool, *sasl_ctx, sasl_dispose_cb,
> apr_pool_cleanup_null);
>
> Then when we clean it up, we do so like this:
>
> static apr_status_t sasl_dispose_cb(void *data)
> {
> sasl_conn_t *sasl_ctx = data;
> sasl_dispose(&sasl_ctx);
> return APR_SUCCESS;
> }
>
> So we're passing the address of the *local* parameter sasl_ctx to
> sasl_dispose(). Presumably, sasl_dispose() NULLs out the variable
> itself after disposing of whatever interior context it contains, but
> we never use that variable again anyway, so it doesn't matter for us.
> Is what's going on here that, for our case, even though the NULLing
> out of the variable is useless, we have to pass it that way simply to
> satisfy sasl_dispose()'s prototype?
Yes, that's exactly what's going on.
--
Vlad
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 22 08:57:32 2006