Skip to content

Commit a37ccd1

Browse files
committed
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.
1 parent 5a5dbc2 commit a37ccd1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

features/storage/FEATURE_STORAGE/cfstore/source/configuration_store.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,11 +2458,11 @@ static int32_t cfstore_file_destroy(cfstore_file_t* file)
24582458
if(cfstore_hkvt_get_flags_delete(&hkvt)){
24592459
ret = cfstore_delete_ex(&hkvt);
24602460
}
2461-
/* reset client buffer to empty ready for reuse */
2462-
/* delete the file even if not deleting the KV*/
2463-
cfstore_listDel(&file->node);
2464-
memset(file, 0, sizeof(cfstore_file_t));
24652461
}
2462+
/* reset client buffer to empty ready for reuse */
2463+
/* delete the file even if not deleting the KV*/
2464+
cfstore_listDel(&file->node);
2465+
memset(file, 0, sizeof(cfstore_file_t));
24662466
}
24672467
return ret;
24682468
}

0 commit comments

Comments
 (0)