mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Fix undefined behavior by making TommyDS foreach callback signatures take void*
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
7250521e66
commit
fd65dbd9ea
13 changed files with 84 additions and 53 deletions
|
|
@ -35,8 +35,10 @@ static inline tommy_uint32_t pool_hash(const char* file)
|
|||
return tommy_hash_u32(0, file, strlen(file));
|
||||
}
|
||||
|
||||
void pool_free(struct snapraid_pool* pool)
|
||||
static void pool_free(void* void_pool)
|
||||
{
|
||||
struct snapraid_pool* pool = void_pool;
|
||||
|
||||
free(pool);
|
||||
}
|
||||
|
||||
|
|
@ -442,12 +444,12 @@ void state_pool(struct snapraid_state* state)
|
|||
msg_progress("Cleaning...\n");
|
||||
|
||||
/* delete all the remaining links */
|
||||
tommy_hashdyn_foreach_arg(&poolset, (tommy_foreach_arg_func*)remove_link, pool_dir);
|
||||
tommy_hashdyn_foreach_arg(&poolset, remove_link, pool_dir);
|
||||
|
||||
/* delete empty dirs */
|
||||
clean_dir(pool_dir);
|
||||
|
||||
tommy_hashdyn_foreach(&poolset, (tommy_foreach_func*)pool_free);
|
||||
tommy_hashdyn_foreach(&poolset, pool_free);
|
||||
tommy_hashdyn_done(&poolset);
|
||||
|
||||
if (count)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue