Call git_pathdup() rather than xstrdup(git_path("..."))

In addition to updating the two xstrdup(git_path("...")) call sites
with git_pathdup(), we also fix a memory leak by freeing the memory
allocated to the ADD_EDIT.patch 'file' in the edit_patch() function.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ramsay Jones
2012-09-04 18:30:21 +01:00
committed by Junio C Hamano
parent 5c44252e13
commit d292bfaf35
2 changed files with 3 additions and 2 deletions

View File

@ -833,7 +833,7 @@ static int check_ancestors(const char *prefix)
*/
static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)
{
char *filename = xstrdup(git_path("BISECT_ANCESTORS_OK"));
char *filename = git_pathdup("BISECT_ANCESTORS_OK");
struct stat st;
int fd;