From 0cb8d0af486d8e5614832749f03a25a6c1801794 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 13 Feb 2016 10:21:25 +1100 Subject: [PATCH] Fix client buffer leak in connector --- src/connector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connector.c b/src/connector.c index 1ea69dc7..781ae906 100644 --- a/src/connector.c +++ b/src/connector.c @@ -208,14 +208,14 @@ static client_instance_t *recruit_client(cdata_t *cdata) } else LOGDEBUG("Connector recycled client instance"); - client->buf = realloc(client->buf, PAGESIZE); - client->buf[0] = '\0'; + client->buf = ckzalloc(PAGESIZE); return client; } static void __recycle_client(cdata_t *cdata, client_instance_t *client) { + dealloc(client->buf); memset(client, 0, sizeof(client_instance_t)); client->id = -1; DL_APPEND(cdata->recycled_clients, client);