summaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorRene Scharfe <l.s.r@web.de>2017-08-30 18:00:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-06 23:49:28 (GMT)
commit85af9f7a027dc5880fd88d65414df2dc6c6f9366 (patch)
tree719e98510bb4c38656f55ed15b6c5a6779360e2a /builtin/remote.c
parentb95c8ce8f3696bd11b38894bb775da17921cc3b8 (diff)
downloadgit-85af9f7a027dc5880fd88d65414df2dc6c6f9366.zip
git-85af9f7a027dc5880fd88d65414df2dc6c6f9366.tar.gz
git-85af9f7a027dc5880fd88d65414df2dc6c6f9366.tar.bz2
remote: release strbuf after use in set_url()
Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/remote.c')
-rw-r--r--builtin/remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 0a56d7d..33ba739 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1565,9 +1565,7 @@ static int set_url(int argc, const char **argv)
"^$", 0);
else
git_config_set(name_buf.buf, newurl);
- strbuf_release(&name_buf);
-
- return 0;
+ goto out;
}
/* Old URL specified. Demand that one matches. */
@@ -1590,6 +1588,8 @@ static int set_url(int argc, const char **argv)
git_config_set_multivar(name_buf.buf, newurl, oldurl, 0);
else
git_config_set_multivar(name_buf.buf, NULL, oldurl, 1);
+out:
+ strbuf_release(&name_buf);
return 0;
}