Skip to content

Commit

Permalink
lib-smtp: client: Fix memory issue caused when reconnecting.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch authored and villesavolainen committed Feb 12, 2019
1 parent 2687917 commit 025f752
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib-smtp/smtp-client-connection.c
Expand Up @@ -1737,7 +1737,7 @@ smtp_client_connection_create(struct smtp_client *client,
conn->host = p_strdup(conn->pool, host);
conn->port = port;
conn->ssl_mode = ssl_mode;
conn->conn.name = p_strdup_printf(conn->pool, "%s:%u", host, port);
conn->conn.name = i_strdup_printf("%s:%u", host, port);

conn->set = client->set;
if (set != NULL) {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/connection.c
Expand Up @@ -229,7 +229,8 @@ void connection_init(struct connection_list *list,
conn->ioloop = current_ioloop;
conn->fd_in = -1;
conn->fd_out = -1;
conn->name = NULL;

i_free(conn->name);

if (conn->event == NULL)
conn->event = event_create(conn->event_parent);
Expand Down

0 comments on commit 025f752

Please sign in to comment.