summaryrefslogtreecommitdiffstats
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 22:03:50 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-27 22:03:50 +0100
commit3d0a936f63f2f894b3986d96cdd8f2baae96150c (patch)
treef661256c3756d9d74ea2cd045115e5488f53388f /builtin-branch.c
parentMerge branch 'js/branch-track' (diff)
parentAvoid unnecessary "if-before-free" tests. (diff)
downloadgit-3d0a936f63f2f894b3986d96cdd8f2baae96150c.tar.xz
git-3d0a936f63f2f894b3986d96cdd8f2baae96150c.zip
Merge branch 'jm/free'
* jm/free: Avoid unnecessary "if-before-free" tests. Conflicts: builtin-branch.c
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index a7844454a2..5bc4526f64 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -121,8 +121,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
continue;
}
- if (name)
- free(name);
+ free(name);
name = xstrdup(mkpath(fmt, argv[i]));
if (!resolve_ref(name, sha1, 1, NULL)) {
@@ -167,8 +166,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
}
}
- if (name)
- free(name);
+ free(name);
return(ret);
}