file_lock:fix memory alloc/free not match
Signed-off-by: guohao15 <guohao15@xiaomi.com>
This commit is contained in:
parent
76a1a5b2c4
commit
94e9599e5c
@ -292,6 +292,16 @@ file_lock_find_bucket(FAR const char *filepath)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: file_lock_free_entry
|
||||
****************************************************************************/
|
||||
|
||||
static void file_lock_free_entry(FAR ENTRY *entry)
|
||||
{
|
||||
lib_free(entry->key);
|
||||
kmm_free(entry->data);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: file_lock_create_bucket
|
||||
****************************************************************************/
|
||||
@ -824,5 +834,6 @@ void file_initlk(void)
|
||||
{
|
||||
/* Initialize file lock context hash table */
|
||||
|
||||
g_file_lock_table.free_entry = file_lock_free_entry;
|
||||
hcreate_r(CONFIG_FS_LOCK_BUCKET_SIZE, &g_file_lock_table);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user