summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-09-14 11:53:53 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-09-14 11:53:53 -0700
commit8c11b25de41857e5a44325046dd55d3751f740c6 (patch)
tree066d739a7361b0341b84ad19ad0d62ad04c1f366 /builtin/add.c
parentMerge branch 'rj/tap-fix' (diff)
parentCall mkpathdup() rather than xstrdup(mkpath(...)) (diff)
downloadtgif-8c11b25de41857e5a44325046dd55d3751f740c6.tar.xz
Merge branch 'rj/path-cleanup'
* rj/path-cleanup: Call mkpathdup() rather than xstrdup(mkpath(...)) Call git_pathdup() rather than xstrdup(git_path("...")) path.c: Use vsnpath() in the implementation of git_path() path.c: Don't discard the return value of vsnpath() path.c: Remove the 'git_' prefix from a file scope function
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 2816789b9d..e664100c71 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -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;
}