summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-07 16:27:54 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-07 16:27:54 +0900
commitcfa0fd0ffc7ae5edcef0615e49b995f3699c07eb (patch)
tree360ea4088ffcd838e7217dafcf0eedb53e2bea00 /builtin/branch.c
parentbd40f41b7b894f9e9258e15acd3620c71c6c4a67 (diff)
parenta9155c50bd52b7e27224e9588780ce5f972fa98d (diff)
downloadgit-cfa0fd0ffc7ae5edcef0615e49b995f3699c07eb.tar.gz
Merge branch 'sb/branch-avoid-repeated-strbuf-release'
* sb/branch-avoid-repeated-strbuf-release: branch: reset instead of release a strbuf
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 89e34e9ceb..d7a876cca3 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -217,7 +217,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;
@@ -282,8 +282,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)