From 1bea35b19a2b952f4af4892c97541fa0715d91b9 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Wed, 15 Feb 2012 15:46:28 -0500 Subject: [PATCH] Sigh. Turns out the first entry in the list isn't actually checked, so we need to make sure that our Local-Mailbox entry starts second. --- sbr/addrsbr.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index ffdac3f..70af81a 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -370,6 +370,9 @@ ismymbox (struct mailname *np) * list of alternate mailboxes. */ if (am == NULL) { + mq.m_next = NULL; + mq.m_mbox = getusername (); + if ((am = context_find ("local-mailbox"))) { struct mailname *mptr; @@ -378,34 +381,20 @@ ismymbox (struct mailname *np) return 0; } - if ((mptr = getm (cp, NULL, 0, AD_NAME, NULL)) == NULL) { + if ((mq.m_next = getm (cp, NULL, 0, AD_NAME, NULL)) == NULL) { admonish (NULL, "invalid entry in local-mailbox: %s", cp); return 0; } /* - * Yes, we're not freeing the whole entry, because all of those - * elements contain allocated pointers that we need; maybe - * later ... - */ - - mq = *mptr; - - free(mptr); - - /* * Sigh, it turns out that the address parser gets messed up * if you don't call getname() until it returns NULL. */ while ((cp = getname(am)) != NULL) ; - } else { - mq.m_mbox = getusername (); } - mq.m_next = NULL; - if ((am = context_find ("alternate-mailboxes")) == NULL) am = getusername(); else { -- 1.7.10.4