X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Findex.cc;h=125fa6c94f2b6612f6aac3e36dfe518753eaddaf;hb=4b0327004a3f9a36352b81a5b778740d68bf3078;hp=65b83b3f706f4fc3df571cd2caefc86c1d25ec10;hpb=4d35c3544d7bb0143cb1a17cc197cfe271670bf8;p=notmuch diff --git a/lib/index.cc b/lib/index.cc index 65b83b3f..125fa6c9 100644 --- a/lib/index.cc +++ b/lib/index.cc @@ -31,7 +31,7 @@ _index_address_mailbox (notmuch_message_t *message, { InternetAddressMailbox *mailbox = INTERNET_ADDRESS_MAILBOX (address); const char *name, *addr; - int own_name = 0; + void *local = talloc_new (NULL); name = internet_address_get_name (address); addr = internet_address_mailbox_get_addr (mailbox); @@ -42,16 +42,16 @@ _index_address_mailbox (notmuch_message_t *message, const char *at; at = strchr (addr, '@'); - if (at) { - name = strndup (addr, at - addr); - own_name = 1; - } + if (at) + name = talloc_strndup (local, addr, at - addr); } if (name) _notmuch_message_gen_terms (message, prefix_name, name); if (addr) _notmuch_message_gen_terms (message, prefix_name, addr); + + talloc_free (local); } static void @@ -198,7 +198,7 @@ _index_mime_part (notmuch_message_t *message, if (i == 1) continue; if (i > 1) - fprintf (stderr, "Warning: Unexpected extra parts of mutlipart/signed. Indexing anyway.\n"); + fprintf (stderr, "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n"); } _index_mime_part (message, g_mime_multipart_get_part (multipart, i));