From 11f39326a8179f231ac8e1cd21610bb6fe0ca301 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 16 Sep 2017 12:08:20 +1000 Subject: [PATCH] Handle null message. --- src/stratifier.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 1567e192..a7309eec 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3307,7 +3307,7 @@ static void _dec_instance_ref(sdata_t *sdata, stratum_instance_t *client, const { char_entry_t *entries = NULL; bool dropped = false; - char *msg; + char *msg = NULL; int ref; ck_wlock(&sdata->instance_lock); @@ -3317,7 +3317,8 @@ static void _dec_instance_ref(sdata_t *sdata, stratum_instance_t *client, const if (unlikely(client->dropped && !ref)) { dropped = true; __drop_client(sdata, client, true, &msg); - add_msg_entry(&entries, &msg); + if (msg) + add_msg_entry(&entries, &msg); } ck_wunlock(&sdata->instance_lock);