aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-18 14:19:14 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-18 14:19:14 +0900
commita116022e03d3ef6b402658a4f41a4840c8463f36 (patch)
tree4ca18383cb9d1503dce01175cae70abd59359825 /builtin
parent4bf90c17408ef3ae4d601e455131dd53967ea884 (diff)
parenta9155c50bd52b7e27224e9588780ce5f972fa98d (diff)
downloadgit-a116022e03d3ef6b402658a4f41a4840c8463f36.tar.gz
git-a116022e03d3ef6b402658a4f41a4840c8463f36.tar.xz
Merge branch 'sb/branch-avoid-repeated-strbuf-release' into maint
* sb/branch-avoid-repeated-strbuf-release: branch: reset instead of release a strbuf
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 16d391b40..2ea92a70b 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -216,7 +216,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
if (!head_rev)
die(_("Couldn't look up commit object for HEAD"));
}
- for (i = 0; i < argc; i++, strbuf_release(&bname)) {
+ for (i = 0; i < argc; i++, strbuf_reset(&bname)) {
char *target = NULL;
int flags = 0;
@@ -281,8 +281,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
}
free(name);
+ strbuf_release(&bname);
- return(ret);
+ return ret;
}
static int calc_maxwidth(struct ref_array *refs, int remote_bonus)