Commit d7eacb96 d7eacb9613d76cf2f91f0278e445a10845bb43b0 by Alain Magloire

forgot to free some memory .. bad.

1 parent 767a2c8e
......@@ -82,6 +82,19 @@ ticket_get_owner (ticket_t ticket)
}
int
ticket_set_pop (ticket_t ticket,
int (*_pop) __P ((ticket_t, const char *, char **)),
void *owner)
{
if (ticket == NULL)
return EINVAL;
if (ticket->owner != owner)
return EACCES;
ticket->_pop = _pop;
return 0;
}
int
ticket_pop (ticket_t ticket, const char *challenge, char **parg)
{
if (ticket == NULL || parg == NULL)
......
......@@ -62,6 +62,7 @@ body_destroy (body_t *pbody, void *owner)
{
if (body->file)
fclose (body->file);
if (body->filename)
free (body->filename);
stream_destroy (&(body->stream), body);
}
......
......@@ -239,7 +239,7 @@ mbox_destroy (mailbox_t mailbox)
for (i = 0; i < mud->umessages_count; i++)
{
mbox_message_t mum = mud->umessages[i];
if (mum == NULL)
if (mum)
{
message_destroy (&(mum->message), mum);
free (mum);
......@@ -334,12 +334,13 @@ mbox_close (mailbox_t mailbox)
{
mbox_message_t mum = mud->umessages[i];
/* Destroy the attach messages. */
if (mum == NULL)
if (mum)
{
message_destroy (&(mum->message), mum);
free (mum);
}
}
if (mud->umessages)
free (mud->umessages);
mud->umessages = NULL;
mud->messages_count = mud->umessages_count = 0;
......