diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-06-22 23:10:27 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-06-22 23:10:27 -0700 |
commit | e1d177b8429e4eb59f5a6e853009dbf97ab95068 (patch) | |
tree | 4733ff57c8a2fbac7470ca64d89852ae01908686 /util.c | |
parent | e9dcae6c35185d58f41d49b8952f9d55984532fd (diff) |
Fix some memory errors (mostly leaks) identified by valgrind
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -359,9 +359,11 @@ uint8_t path_matches_extensions(char *path, char **ext_list, uint32_t num_exts) for (extidx = 0; extidx < num_exts; extidx++) { if (!strcasecmp(ext, ext_list[extidx])) { + free(ext); return 1; } } + free(ext); return 0; } @@ -721,6 +723,7 @@ dir_entry *get_dir_list(char *path, size_t *numret) if (numret) { *numret = pos; } + closedir(d); return ret; } |