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

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

Date: Fri, 09 Dec 2011 15:52:24 +0200

To: notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


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


Thread: