From 712d5c38d6fe455352ee8cd629e89ac659857351 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 21 Jan 2015 12:37:23 +1100 Subject: [PATCH] Make sure a passthrough client is still in the hash table before deleting it --- src/stratifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index b7687b0c..89f964cb 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3017,7 +3017,8 @@ static void parse_method(sdata_t *sdata, const int64_t client_id, json_t *id_val * Remove this instance since the client id may well be * reused */ ck_wlock(&sdata->instance_lock); - HASH_DEL(sdata->stratum_instances, client); + if (likely(__instance_by_id(sdata, client_id))) + HASH_DEL(sdata->stratum_instances, client); ck_wunlock(&sdata->instance_lock); LOGNOTICE("Adding passthrough client %ld", client->id);