aboutsummaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 13:03:50 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-27 13:03:50 -0800
commit3d0a936f63f2f894b3986d96cdd8f2baae96150c (patch)
treef661256c3756d9d74ea2cd045115e5488f53388f /builtin-branch.c
parent60b188a9844cdcf865174c685a38acc053a9d43b (diff)
parent8e0f70033b2bd1679a6e5971978fdc3ee09bdb72 (diff)
downloadgit-3d0a936f63f2f894b3986d96cdd8f2baae96150c.tar.gz
git-3d0a936f63f2f894b3986d96cdd8f2baae96150c.tar.xz
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 a7844454a..5bc4526f6 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);
}