Merge branch 'ab/sha1dc-maint'
[gitweb.git] / builtin / worktree.c
index 0c5476ee9de464cb0fae22c49775bc10efb0731b..c98e2ce5f57c1f41ccaf90041a1a22233ae75551 100644 (file)
@@ -300,10 +300,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) {