[Patch 1/2] separate handling when addresses == NULL

Tomi Ollila tomi.ollila at iki.fi
Fri Dec 9 05:52:24 PST 2011


When addresses is NULL, (future) addresses object cleanup is not needed.
---
 notmuch-show.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 603992a..c27ef6a 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -239,7 +239,11 @@ _extract_email_address (const void *ctx, const char *from)
     addresses = internet_address_list_parse_string (from);
 
     /* Bail if there is no address here. */
-    if (addresses == NULL || internet_address_list_length (addresses) < 1)
+    if (addresses == NULL)
+	return email;
+
+    /* Bail if there is no address here. */
+    if (internet_address_list_length (addresses) < 1)
 	goto DONE;
 
     /* Otherwise, just use the first address. */
-- 
1.7.7.3



More information about the notmuch mailing list