Skip to content

Commit

Permalink
lib-smtp: smtp-address - Don't return NULL from smtp_address_clone*()…
Browse files Browse the repository at this point in the history
… unless the input is NULL.
  • Loading branch information
stephanbosch authored and sirainen committed Apr 1, 2020
1 parent a66d73c commit b34002a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib-smtp/smtp-address.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ smtp_address_clone(pool_t pool, const struct smtp_address *src)
size_t size, lpsize = 0, dsize = 0, rsize = 0;
char *data, *localpart = NULL, *domain = NULL, *raw = NULL;

if (src == NULL || (smtp_address_isnull(src) && src->raw == NULL))
if (src == NULL)
return NULL;

/* @UNSAFE */
Expand Down Expand Up @@ -857,7 +857,7 @@ struct smtp_address *smtp_address_clone_temp(const struct smtp_address *src)
{
struct smtp_address *new;

if (src == NULL || (smtp_address_isnull(src) && src->raw == NULL))
if (src == NULL)
return NULL;

new = t_new(struct smtp_address, 1);
Expand Down

0 comments on commit b34002a

Please sign in to comment.