mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Removes a memory leak in dup.
This commit is contained in:
parent
ca2da5178a
commit
8784a42016
1 changed files with 7 additions and 5 deletions
12
dup.c
12
dup.c
|
|
@ -104,17 +104,19 @@ void state_dup(struct snapraid_state* state)
|
|||
/* for each file */
|
||||
for(j=disk->filelist;j!=0;j=j->next) {
|
||||
struct snapraid_file* file = j->data;
|
||||
struct snapraid_hash* hash = hash_alloc(disk, file);
|
||||
struct snapraid_hash* hash;
|
||||
tommy_hash_t hash32;
|
||||
|
||||
/* if no hash, skip it */
|
||||
if (!hash)
|
||||
continue;
|
||||
|
||||
/* if empty, skip it */
|
||||
if (file->size == 0)
|
||||
continue;
|
||||
|
||||
hash = hash_alloc(disk, file);
|
||||
|
||||
/* if no hash, skip it */
|
||||
if (!hash)
|
||||
continue;
|
||||
|
||||
hash32 = hash_hash(hash);
|
||||
|
||||
struct snapraid_hash* dup = tommy_hashdyn_search(&hashset, hash_compare, hash->hash, hash32);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue