Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'cc/untracked'
author
Junio C Hamano
<gitster@pobox.com>
Tue, 11 Apr 2017 07:21:51 +0000
(
00:21
-0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 11 Apr 2017 07:21:51 +0000
(
00:21
-0700)
Code cleanup.
* cc/untracked:
update-index: fix xgetcwd() related memory leak
builtin/update-index.c
patch
|
blob
|
history
raw
(from parent 1:
d9758cf
)
diff --git
a/builtin/update-index.c
b/builtin/update-index.c
index d74d72cc7fad93980abd409d2c9dc10ae4652fd3..ebfc09faa0d604218af8f5815af5e5fee5915158 100644
(file)
--- a/
builtin/update-index.c
+++ b/
builtin/update-index.c
@@
-125,12
+125,16
@@
static int test_if_untracked_cache_is_supported(void)
struct stat st;
struct stat_data base;
int fd, ret = 0;
+ char *cwd;
strbuf_addstr(&mtime_dir, "mtime-test-XXXXXX");
if (!mkdtemp(mtime_dir.buf))
die_errno("Could not make temporary directory");
- fprintf(stderr, _("Testing mtime in '%s' "), xgetcwd());
+ cwd = xgetcwd();
+ fprintf(stderr, _("Testing mtime in '%s' "), cwd);
+ free(cwd);
+
atexit(remove_test_directory);
xstat_mtime_dir(&st);
fill_stat_data(&base, &st);