From b69037680d470b7a0e10567d2fa4fe7ef293fa52 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 29 Jan 2015 14:57:04 +1100 Subject: [PATCH] Don't bother NULLing automatic json params variables at end of functions --- src/stratifier.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index ff8887ea..a349b46a 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3486,13 +3486,12 @@ static void ssend_process(ckpool_t *ckp, smsg_t *msg) free_smsg(msg); } -static void discard_json_params(json_params_t **jp) +static void discard_json_params(json_params_t *jp) { - json_decref((*jp)->method); - json_decref((*jp)->params); - json_decref((*jp)->id_val); - free(*jp); - *jp = NULL; + json_decref(jp->method); + json_decref(jp->params); + json_decref(jp->id_val); + free(jp); } static void sshare_process(ckpool_t *ckp, json_params_t *jp) @@ -3522,7 +3521,7 @@ static void sshare_process(ckpool_t *ckp, json_params_t *jp) out_decref: dec_instance_ref(sdata, client); out: - discard_json_params(&jp); + discard_json_params(jp); } static void sauth_process(ckpool_t *ckp, json_params_t *jp) @@ -3574,7 +3573,7 @@ static void sauth_process(ckpool_t *ckp, json_params_t *jp) out: if (client) dec_instance_ref(sdata, client); - discard_json_params(&jp); + discard_json_params(jp); } @@ -3768,9 +3767,9 @@ static void send_transactions(ckpool_t *ckp, json_params_t *jp) out_send: stratum_add_send(sdata, val, jp->client_id); out: - discard_json_params(&jp); if (client) dec_instance_ref(sdata, client); + discard_json_params(jp); } /* Called 32 times per min, we send the updated stats to ckdb of those users