summaryrefslogtreecommitdiff
path: root/mesh/mesh-config.h
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2020-05-20 15:14:38 -0700
committerBrian Gix <brian.gix@intel.com>2020-05-20 15:16:55 -0700
commit0e8ed1f261cf336ce1ec8b3b514e4794ac8f058c (patch)
treecc168ed8a283d7d66b83a5dd828514e8a25e1dea /mesh/mesh-config.h
parent5b6536954b53afe1eebb4d54578cb45953456023 (diff)
downloadbluez-0e8ed1f261cf336ce1ec8b3b514e4794ac8f058c.tar.gz
mesh: Fix double-free
This fixes a double-free error when destroying the NVM storage of a mesh node. Cleanly handle two distinct scenarios: 1. When the node is being deleted at runtime. This causes release of both dynamic memory and NVM storage. 2. During shutdown, we release dynamic memory only.
Diffstat (limited to 'mesh/mesh-config.h')
-rw-r--r--mesh/mesh-config.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesh/mesh-config.h b/mesh/mesh-config.h
index 25002f5a7..8ff7b63c7 100644
--- a/mesh/mesh-config.h
+++ b/mesh/mesh-config.h
@@ -114,7 +114,7 @@ typedef bool (*mesh_config_node_func_t)(struct mesh_config_node *node,
bool mesh_config_load_nodes(const char *cfgdir_name, mesh_config_node_func_t cb,
void *user_data);
void mesh_config_release(struct mesh_config *cfg);
-void mesh_config_destroy(struct mesh_config *cfg);
+void mesh_config_destroy_nvm(struct mesh_config *cfg);
bool mesh_config_save(struct mesh_config *cfg, bool no_wait,
mesh_config_status_func_t cb, void *user_data);
struct mesh_config *mesh_config_create(const char *cfgdir_name,