From 83be4d1f7e3782f420bd52d754a21dff148067dd Mon Sep 17 00:00:00 2001 From: jaylin Date: Tue, 9 Apr 2024 17:53:00 +0800 Subject: [PATCH] * FIX [mqtt_db] free rw_lock in topic_node Signed-off-by: jaylin --- src/supplemental/nanolib/mqtt_db.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/supplemental/nanolib/mqtt_db.c b/src/supplemental/nanolib/mqtt_db.c index 3c4a4af9e..3d8bfd197 100644 --- a/src/supplemental/nanolib/mqtt_db.c +++ b/src/supplemental/nanolib/mqtt_db.c @@ -905,9 +905,8 @@ delete_dbtree_node(dbtree_node *node, size_t index) log_debug("Delete node: [%s]", node_t->topic); cvector_free(node_t->child); cvector_free(node_t->clients); - free(node_t->topic); cvector_erase(node->child, index); - free(node_t); + dbtree_node_free(node_t); node_t = NULL; if (index == 0) { if (node->plus >= 0) {