On Thu, 14 Oct 2004, Mark Crispin wrote:

> No, you do not (MUST NOT) free any resource returned by any mail_?????()
> functions.  These resources are cached on the stream and are freed when
> the stream closes.

Ok. Thanks for clearing that up.

> You are, however, required to free resources that you created via:
>       fs_get()
>       cpystr(), cpytxt(), textcpy(), textcpystring(), textcpyoffstring()
>       rfc822_base64(), rfc822_binary(), rfc822_qprint(), rfc822_8bit()
>       utf8_text(), utf8_cstext(), utf8_cstocstext(), utf8_mime2text()
>
> Note that in the case of the utf8_????() functions, you must check to see
> if the returned value is the same as the source, since these will not
> create a new copy if no conversions need to be done and instead will just
> return the argument.

Thanks for the warning. That could be tricky if you feed it something
that is supposed to be freed by the library.

Reply via email to