diff options
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r-- | camel/camel-mime-utils.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index 22b252116b..65bbdf32e8 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -1293,6 +1293,7 @@ header_decode_addrspec(const char **in) word = header_decode_domain(&inptr); if (word) { addr = g_string_append(addr, word); + g_free(word); } else { w(g_warning("Invalid address, missing domain: %s", *in)); } @@ -1392,8 +1393,10 @@ header_decode_mailbox(const char **in) inptr++; g_free(pre); pre = header_decode_word(&inptr); - addr = g_string_append_c(addr, '.'); - addr = g_string_append(addr, pre); + if (pre) { + addr = g_string_append_c(addr, '.'); + addr = g_string_append(addr, pre); + } header_decode_lwsp(&inptr); } g_free(pre); @@ -2274,12 +2277,13 @@ void header_address_list_append(struct _header_address **l, struct _header_addre void header_address_list_clear(struct _header_address **l) { struct _header_address *a, *n; - a = (struct _header_address *)l; - while (a && a->next) { + a = *l; + while (a) { n = a->next; - a = n->next; - header_address_unref(n); + header_address_unref(a); + a = n; } + *l = NULL; } static void |