From 4e2d094dde4f078245d057dd6111ab9d013ae6d0 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 4 Sep 2012 18:31:14 +0100 Subject: Call mkpathdup() rather than xstrdup(mkpath(...)) In addition to updating the xstrdup(mkpath(...)) call sites with mkpathdup(), we also fix a memory leak (in merge_3way()) caused by neglecting to free the memory allocated to the 'base_name' variable. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- builtin/prune.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/prune.c') diff --git a/builtin/prune.c b/builtin/prune.c index b99b635e4..f66ff676e 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -168,7 +168,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix) prune_packed_objects(show_only); remove_temporary_files(get_object_directory()); - s = xstrdup(mkpath("%s/pack", get_object_directory())); + s = mkpathdup("%s/pack", get_object_directory()); remove_temporary_files(s); free(s); return 0; -- cgit v1.2.1