From 40157dcce5ba73baa5093bfa9882ef54e45a56b7 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 19 Jul 2019 14:06:05 +0200 Subject: [PATCH] mesh: fix config_model_subscription_overwrite_handler --- src/mesh/mesh_configuration_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/mesh_configuration_server.c b/src/mesh/mesh_configuration_server.c index 1bfaf97b1..5c6d872bf 100644 --- a/src/mesh/mesh_configuration_server.c +++ b/src/mesh/mesh_configuration_server.c @@ -1181,8 +1181,8 @@ static void config_model_subscription_overwrite_handler(mesh_model_t *mesh_model if (target_model != NULL){ if (mesh_network_address_group(address) && !mesh_network_address_all_nodes(address)){ mesh_subcription_decrease_virtual_address_ref_count(target_model); - mesh_model_delete_all_subscriptions(mesh_model); - mesh_model_add_subscription(mesh_model, address); + mesh_model_delete_all_subscriptions(target_model); + mesh_model_add_subscription(target_model, address); mesh_model_store_subscriptions(target_model); } else { status = MESH_FOUNDATION_STATUS_INVALID_ADDRESS;