From bb8593bfa0cd7d9662421f9670ab86853dd91fd5 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 21 Jan 2015 13:02:56 +1100 Subject: [PATCH] Take the same attendant precautions when deleting passthrough client ram as regular clients by adding them to the dead list --- src/stratifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 89f964cb..7c05def1 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3019,13 +3019,13 @@ static void parse_method(sdata_t *sdata, const int64_t client_id, json_t *id_val ck_wlock(&sdata->instance_lock); if (likely(__instance_by_id(sdata, client_id))) HASH_DEL(sdata->stratum_instances, client); + __add_dead(sdata, client); ck_wunlock(&sdata->instance_lock); LOGNOTICE("Adding passthrough client %ld", client->id); snprintf(buf, 255, "passthrough=%ld", client->id); send_proc(client->ckp->connector, buf); - free(client); - return; + goto out; } if (cmdmatch(method, "mining.auth") && client->subscribed) {