diff options
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r-- | builtin/worktree.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 793306ea51..41d1c007a4 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -299,10 +299,8 @@ static int add_worktree(const char *path, const char *refname, } is_junk = 0; - free(junk_work_tree); - free(junk_git_dir); - junk_work_tree = NULL; - junk_git_dir = NULL; + FREE_AND_NULL(junk_work_tree); + FREE_AND_NULL(junk_git_dir); done: if (ret || !opts->keep_locked) { |