(sorry for spam to both lists the first time)

On Fri, Mar 03, 2006 at 11:26:46AM -0600, Matthew Sayler wrote:
> Messages are inserted into the database just fine, but dbmail-smtp
> segfaults (causing qmail to retry the delivery.. ad nausium).  A quick
> poke at executing show a segfault in dsnuser_free.  gdb'ing shows that
> the arg start to dm_list_free is null:

Note, this failure mode is bogus (and only covers the case where you run
dbmail-smtpd with no args).

Looking a bit closer (and forgive me--this is my first pass at this
code):

main.c:

        trace(TRACE_DEBUG, "main(): freeing dsnuser list");
        /*must loop to get the memory for the strdup of the mailbox */
        /*
        for (tmp = dm_list_getstart(&dsnusers);
                        tmp != NULL;
                        tmp = tmp->nextnode) {
                dm_free( ((deliver_to_user_t *)tmp->data)->mailbox );
        }
        */
        dsnuser_free_list(&dsnusers);
        dsnuser_free(&dsnuser);

        trace(TRACE_DEBUG, "main(): freeing all other lists");

dsn.c:

dsnuser_free_list(struct dm_list *deliveries)
{
        struct element *tmp;
                                
        for (tmp = dm_list_getstart(deliveries); tmp != NULL;
             tmp = tmp->nextnode)
                dsnuser_free((deliver_to_user_t *) tmp->data);

        dm_list_free(&deliveries->start);
}       

Double-free?

Matt

Reply via email to