diff options
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c index 8cf0673adc..0b166c211a 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1690,9 +1690,10 @@ unmap: */ static void freshen_shared_index(char *base_sha1_hex, int warn) { - const char *shared_index = git_path("sharedindex.%s", base_sha1_hex); + char *shared_index = git_pathdup("sharedindex.%s", base_sha1_hex); if (!check_and_freshen_file(shared_index, 1) && warn) warning("could not freshen shared index '%s'", shared_index); + free(shared_index); } int read_index_from(struct index_state *istate, const char *path) |