summaryrefslogtreecommitdiff
path: root/mesh/model.c
diff options
context:
space:
mode:
authorRafaƂ Gajda <rafal.gajda@silvair.com>2019-11-18 11:51:18 +0100
committerBrian Gix <brian.gix@intel.com>2019-11-19 15:22:18 -0800
commit53a81750db14187e80e378a11c21a9b6240ac9c9 (patch)
tree60b93bb499db38bd3a7427142822bab14136820d /mesh/model.c
parent8a29b59d98b301df8331b4ca4dc9e150e67beee6 (diff)
downloadbluez-53a81750db14187e80e378a11c21a9b6240ac9c9.tar.gz
mesh: Fix crash after deleting all subscriptions
Diffstat (limited to 'mesh/model.c')
-rw-r--r--mesh/model.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mesh/model.c b/mesh/model.c
index 84f1dc74c..de271f171 100644
--- a/mesh/model.c
+++ b/mesh/model.c
@@ -1482,9 +1482,8 @@ int mesh_model_sub_del_all(struct mesh_node *node, uint16_t addr, uint32_t id)
for (; entry; entry = entry->next)
mesh_net_dst_unreg(net, (uint16_t) L_PTR_TO_UINT(entry->data));
- l_queue_destroy(mod->subs, NULL);
- l_queue_destroy(mod->virtuals, unref_virt);
- mod->virtuals = l_queue_new();
+ l_queue_clear(mod->subs, NULL);
+ l_queue_clear(mod->virtuals, unref_virt);
return MESH_STATUS_SUCCESS;
}