]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: client: Fix memory issue caused when reconnecting.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 29 Sep 2018 18:38:44 +0000 (20:38 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 10 Oct 2018 09:49:07 +0000 (09:49 +0000)
src/lib-smtp/smtp-client-connection.c
src/lib/connection.c

index 5d07429cccf09d8c21edb8316407a984fb454fbe..3e48e8473abe620a203791eb0cfbc9970a48a210 100644 (file)
@@ -1734,7 +1734,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) {
index 8f493232333627fc9ed742256eb81c1620b59110..95497e2402caaedf4027e1d39cbe8db151a946e3 100644 (file)
@@ -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);