Commit 4a2becbd authored by Kevin J. McCarthy's avatar Kevin J. McCarthy
Browse files

Fix memory leak parsing group addresses without a display name.

When there was a group address terminator with no previous
addresses (including the group display-name), an address would be
allocated but not attached to the address list.

Change this to only allocate when last exists.

It would be more correct to not allocate at all unless we are inside a
group list, but I will address that in a separate commit to master.
parent 464a9bc6
Pipeline #242883597 passed with stages
in 3 minutes and 1 second
...@@ -587,11 +587,10 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) ...@@ -587,11 +587,10 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s)
#endif #endif
/* add group terminator */ /* add group terminator */
cur = rfc822_new_address ();
if (last) if (last)
{ {
last->next = cur; last->next = rfc822_new_address ();
last = cur; last = last->next;
} }
phraselen = 0; phraselen = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment