summaryrefslogtreecommitdiff
path: root/builtin/stash.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/stash.c')
-rw-r--r--builtin/stash.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin/stash.c b/builtin/stash.c
index 10d87630cd..4bdfaf8397 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -864,7 +864,7 @@ static int get_untracked_files(const struct pathspec *ps, int include_untracked,
int found = 0;
struct dir_struct dir;
- memset(&dir, 0, sizeof(dir));
+ dir_init(&dir);
if (include_untracked != INCLUDE_ALL_FILES)
setup_standard_excludes(&dir);
@@ -875,12 +875,9 @@ static int get_untracked_files(const struct pathspec *ps, int include_untracked,
strbuf_addstr(untracked_files, ent->name);
/* NUL-terminate: will be fed to update-index -z */
strbuf_addch(untracked_files, '\0');
- free(ent);
}
- free(dir.entries);
- free(dir.ignored);
- clear_directory(&dir);
+ dir_clear(&dir);
return found;
}