summaryrefslogtreecommitdiff
path: root/builtin-reflog.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-11-05 11:35:53 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-11-05 11:35:53 -0800
commita1a846a19e854a3b3baff8f55c039846880a2635 (patch)
tree0d6aebb3626cbc4204a1ec455e3b2105b4733062 /builtin-reflog.c
parentMerge branch 'jc/gitweb-fix-cloud-tag' (diff)
parentMerge branch 'ar/maint-mksnpath' into ar/mksnpath (diff)
downloadtgif-a1a846a19e854a3b3baff8f55c039846880a2635.tar.xz
Merge branch 'ar/mksnpath'
* ar/mksnpath: Use git_pathdup instead of xstrdup(git_path(...)) git_pathdup: returns xstrdup-ed copy of the formatted path Fix potentially dangerous use of git_path in ref.c Add git_snpath: a .git path formatting routine with output buffer Fix potentially dangerous uses of mkpath and git_path Fix potentially dangerous uses of mkpath and git_path Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c Add mksnpath which allows you to specify the output buffer Conflicts: builtin-revert.c
Diffstat (limited to 'builtin-reflog.c')
-rw-r--r--builtin-reflog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 6b3667ef0e..d95f515f2e 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -277,11 +277,11 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
lock = lock_any_ref_for_update(ref, sha1, 0);
if (!lock)
return error("cannot lock ref '%s'", ref);
- log_file = xstrdup(git_path("logs/%s", ref));
+ log_file = git_pathdup("logs/%s", ref);
if (!file_exists(log_file))
goto finish;
if (!cmd->dry_run) {
- newlog_path = xstrdup(git_path("logs/%s.lock", ref));
+ newlog_path = git_pathdup("logs/%s.lock", ref);
cb.newlog = fopen(newlog_path, "w");
}