mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 12:57:14 -05:00
Fix leak on error in state_write
This commit is contained in:
parent
4bac0a9ed2
commit
fcfd1eeae8
1 changed files with 7 additions and 0 deletions
|
|
@ -4117,10 +4117,17 @@ static void* state_write_thread(void* arg)
|
||||||
if (context->first)
|
if (context->first)
|
||||||
bucket_to_list(&bucket_hash, &state->bucketlist, &state->bucketcount);
|
bucket_to_list(&bucket_hash, &state->bucketlist, &state->bucketcount);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Do not need to free the bucket entries in the success path because they
|
||||||
|
* are added only if context->first is true, and they are already moved
|
||||||
|
* to the list.
|
||||||
|
*/
|
||||||
|
|
||||||
tommy_hashdyn_done(&bucket_hash);
|
tommy_hashdyn_done(&bucket_hash);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
|
tommy_hashdyn_foreach(&bucket_hash, (tommy_foreach_func*)bucket_free);
|
||||||
tommy_hashdyn_done(&bucket_hash);
|
tommy_hashdyn_done(&bucket_hash);
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue