From a37ccd1133b976d514669e4f4b839a187ccfefa5 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Sun, 16 Oct 2016 20:19:49 -0500 Subject: [PATCH] CFSTORE - Delete handle even if key ref non zero When closing a file handle remove the handle from the handle list regardless of what the reference count of the key it is pointing to is. This prevents config store from keeping a handle to file handles that have gone out of scope. --- .../FEATURE_STORAGE/cfstore/source/configuration_store.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/storage/FEATURE_STORAGE/cfstore/source/configuration_store.c b/features/storage/FEATURE_STORAGE/cfstore/source/configuration_store.c index d631f4c6fe..edeb5d7123 100644 --- a/features/storage/FEATURE_STORAGE/cfstore/source/configuration_store.c +++ b/features/storage/FEATURE_STORAGE/cfstore/source/configuration_store.c @@ -2458,11 +2458,11 @@ static int32_t cfstore_file_destroy(cfstore_file_t* file) if(cfstore_hkvt_get_flags_delete(&hkvt)){ ret = cfstore_delete_ex(&hkvt); } - /* reset client buffer to empty ready for reuse */ - /* delete the file even if not deleting the KV*/ - cfstore_listDel(&file->node); - memset(file, 0, sizeof(cfstore_file_t)); } + /* reset client buffer to empty ready for reuse */ + /* delete the file even if not deleting the KV*/ + cfstore_listDel(&file->node); + memset(file, 0, sizeof(cfstore_file_t)); } return ret; }