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 <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
d292bfaf35
commit
4e2d094dde
@ -196,7 +196,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
|
||||
|
||||
free(name);
|
||||
|
||||
name = xstrdup(mkpath(fmt, bname.buf));
|
||||
name = mkpathdup(fmt, bname.buf);
|
||||
if (read_ref(name, sha1)) {
|
||||
error(remote_branch
|
||||
? _("remote branch '%s' not found.")
|
||||
|
||||
Reference in New Issue
Block a user