From 0900b5d5c5b84ead8d8fd031278cdc97a2095cdb Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 13 Mar 2015 09:36:53 +1100 Subject: [PATCH] Check for no user in __drop_client --- src/stratifier.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index f9af16b4..4c191dc3 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1258,9 +1258,15 @@ static void __drop_client(sdata_t *sdata, stratum_instance_t *client, user_insta client->disconnected_time = time(NULL); } else { if (client->workername) { - ASPRINTF(msg, "Client %"PRId64" %s %suser %s worker %s dropped %s", - client->id, client->address, user->throttled ? "throttled " : "", - user->username, client->workername, lazily ? "lazily" : ""); + if (user) { + ASPRINTF(msg, "Client %"PRId64" %s %suser %s worker %s dropped %s", + client->id, client->address, user->throttled ? "throttled " : "", + user->username, client->workername, lazily ? "lazily" : ""); + } else { + ASPRINTF(msg, "Client %"PRId64" %s no user worker %s dropped %s", + client->id, client->address, client->workername, + lazily ? "lazily" : ""); + } } else { ASPRINTF(msg, "Workerless client %"PRId64" %s dropped %s", client->id, client->address, lazily ? "lazily" : "");