]> Pileus Git - ~andy/git/blobdiff - builtin/add.c
Call git_pathdup() rather than xstrdup(git_path("..."))
[~andy/git] / builtin / add.c
index 89dce56a240d69ccb224590bf134c9656d8a0522..2fc267742239c6360c4a38cab7a0277d3407bac2 100644 (file)
@@ -260,7 +260,7 @@ int interactive_add(int argc, const char **argv, const char *prefix, int patch)
 
 static int edit_patch(int argc, const char **argv, const char *prefix)
 {
-       char *file = xstrdup(git_path("ADD_EDIT.patch"));
+       char *file = git_pathdup("ADD_EDIT.patch");
        const char *apply_argv[] = { "apply", "--recount", "--cached",
                NULL, NULL };
        struct child_process child;
@@ -303,6 +303,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
                die (_("Could not apply '%s'"), file);
 
        unlink(file);
+       free(file);
        return 0;
 }