# HG changeset patch # User Matti Hamalainen # Date 1403394306 -10800 # Node ID 452adc41ccf59752fd11dfc478f1502d6c3dcbe0 # Parent 8c39e8e90dbd04e6a61e3bb40b5366565f683ebb Remember to free the connection data buffer. diff -r 8c39e8e90dbd -r 452adc41ccf5 th_network.c --- a/th_network.c Sun Jun 22 02:12:17 2014 +0300 +++ b/th_network.c Sun Jun 22 02:45:06 2014 +0300 @@ -123,9 +123,11 @@ if (conn == NULL) return NULL; + // Set function pointers conn->errfunc = errfunc; conn->msgfunc = msgfunc; + // Allocate connection data buffer conn->bufsize = (bufsize <= 0) ? TH_CONNBUF_SIZE : bufsize; if ((conn->buf = th_malloc(conn->bufsize)) == NULL) { @@ -678,6 +680,7 @@ static void th_conn_free_nodelete(th_conn_t *conn) { + th_free(conn->buf); th_conn_close(conn); th_free(conn->host); th_free(conn->proxy.host);