From 18ea97c468047da56bbf3eea5146130a87163254 Mon Sep 17 00:00:00 2001 From: linkkzz Date: Fri, 30 Jun 2023 11:29:40 +0800 Subject: [PATCH] Fixes sub_count is not decreased when client ubsubscribe Signed-off-by: linkkzz --- src/subs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/subs.c b/src/subs.c index 687537d9..c5c6b5a3 100644 --- a/src/subs.c +++ b/src/subs.c @@ -389,6 +389,7 @@ static int sub__remove_normal(struct mosquitto *context, struct mosquitto__subhi if(context->subs[i] && context->subs[i]->hier == subhier){ mosquitto__free(context->subs[i]); context->subs[i] = NULL; + context->sub_count--; break; } } @@ -429,6 +430,7 @@ static int sub__remove_shared(struct mosquitto *context, struct mosquitto__subhi mosquitto__free(context->subs[i]); context->subs[i] = NULL; + context->sub_count--; break; } }