Browse Source

Fix client buffer leak in connector

master
Con Kolivas 9 years ago
parent
commit
0cb8d0af48
  1. 4
      src/connector.c

4
src/connector.c

@ -208,14 +208,14 @@ static client_instance_t *recruit_client(cdata_t *cdata)
} else } else
LOGDEBUG("Connector recycled client instance"); LOGDEBUG("Connector recycled client instance");
client->buf = realloc(client->buf, PAGESIZE); client->buf = ckzalloc(PAGESIZE);
client->buf[0] = '\0';
return client; return client;
} }
static void __recycle_client(cdata_t *cdata, client_instance_t *client) static void __recycle_client(cdata_t *cdata, client_instance_t *client)
{ {
dealloc(client->buf);
memset(client, 0, sizeof(client_instance_t)); memset(client, 0, sizeof(client_instance_t));
client->id = -1; client->id = -1;
DL_APPEND(cdata->recycled_clients, client); DL_APPEND(cdata->recycled_clients, client);

Loading…
Cancel
Save