Subject: freeing memory

From: "DINH V. Hoà" <[email-masked]>
Date: Fri, 24 Nov 2000 19:59:24 +0000

when we read a mail via
  stream = mail_open(stream, mailbox, 0);
and when we fetch mail, envelope, etc ...

What memory do we exactly have to free ?

thanks.

-- 
Hoa
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Fri, 24 Nov 2000 11:08:45 -0800 (PST)

> What memory do we exactly have to free ?

You only free memory that you created in your application, either
 1) directly by fs_get(), cpystr(), or any mail_new???() function.
 2) indirectly by the following functions: mail_sort(), mail_thread(),
    rfc822_base64(), rfc822_binary(), rfc822_qprint(), and rfc822_8bit().

All memory created by c-client is freed by mail_close() of the mailstream
which owns that memory.  Do not attempt to free any memory returned by any
mail_fetch_???() routines.

Put another way, you must free an envelope that you created yourself for
sending a message, but you must not free an envelope returned by
mail_fetch_structure().