mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-01 12:26:38 -05:00
Removes a memory leak in dup.
This commit is contained in:
parent
ca2da5178a
commit
e8835be4ee
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 each file */
|
||||||
for(j=disk->filelist;j!=0;j=j->next) {
|
for(j=disk->filelist;j!=0;j=j->next) {
|
||||||
struct snapraid_file* file = j->data;
|
struct snapraid_file* file = j->data;
|
||||||
struct snapraid_hash* hash = hash_alloc(disk, file);
|
struct snapraid_hash* hash;
|
||||||
tommy_hash_t hash32;
|
tommy_hash_t hash32;
|
||||||
|
|
||||||
/* if no hash, skip it */
|
|
||||||
if (!hash)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* if empty, skip it */
|
/* if empty, skip it */
|
||||||
if (file->size == 0)
|
if (file->size == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
hash = hash_alloc(disk, file);
|
||||||
|
|
||||||
|
/* if no hash, skip it */
|
||||||
|
if (!hash)
|
||||||
|
continue;
|
||||||
|
|
||||||
hash32 = hash_hash(hash);
|
hash32 = hash_hash(hash);
|
||||||
|
|
||||||
struct snapraid_hash* dup = tommy_hashdyn_search(&hashset, hash_compare, hash->hash, hash32);
|
struct snapraid_hash* dup = tommy_hashdyn_search(&hashset, hash_compare, hash->hash, hash32);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue