Fix memleaks from unclosed opendir calls

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This commit is contained in:
Daniel Danzberger 2020-01-04 22:41:07 +01:00
parent 258331fdd5
commit 95e1f34a7f
2 changed files with 4 additions and 0 deletions

View file

@ -467,6 +467,7 @@ int get_USB_InterfaceNumberOfEntries(char *refparam, struct dmctx *ctx, void *da
nbre++;
}
}
closedir(dir);
dmasprintf(value, "%d", nbre);
return 0;
}

View file

@ -1133,6 +1133,9 @@ int synchronize_system_folders_with_dmmap_opt(char *sysfsrep, char *dmmap_packag
else
add_sysfs_sectons_list_paramameter(dup_list, dmmap_sect, ent->d_name, sysfs_rep_path);
}
if (dir)
closedir(dir);
/*
* fusion two lists
*/