memory management

Arvind Sachdeva asachdeva at gmail.com
Mon Oct 10 11:19:25 EDT 2005


ahh!! so I will have to store all my pointers till mech_dispose is called, a
list of pointers in conn_context, isnt that bad ?

On 10/10/05, Ken Murchison <ken at oceana.com> wrote:
>
> Arvind Sachdeva wrote:
>
> > Hi,
> >
> > I am writing client/server plugin for cyrus library. I allocated memory
> > for serverout string in mech_step function on server side. Where is this
> > string supposed to be freed ? According to the general convention if my
> > plugin allocates the memory it should be freeing it. But I dont
> > understand in which function should I free the memory.
> > Should I cache the pointer and free it on subsequent mech_step call, or
> > should I do something like cache all pointers and free them at the end.
> >
> > Or am I missing a simple function that will be called back from the
> > application just for this purpose ?
>
> You'd probably free() the memory in mech_dispose() or mech_free(). You
> could probably use the PLAIN plugin as a template.
>
> --
> Kenneth Murchison Oceana Matrix Ltd.
> Software Engineer 21 Princeton Place
> 716-662-8973 x26 Orchard Park, NY 14127
> --PGP Public Key-- http://www.oceana.com/~ken/ksm.pgp
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/cyrus-sasl/attachments/20051010/8b9311f3/attachment.html


More information about the Cyrus-sasl mailing list