From: Rene Scharfe Date: Wed, 30 Aug 2017 18:00:27 +0000 (+0200) Subject: remote: release strbuf after use in set_url() X-Git-Tag: v2.15.0-rc0~78^2~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/85af9f7a027dc5880fd88d65414df2dc6c6f9366?ds=sidebyside remote: release strbuf after use in set_url() Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/builtin/remote.c b/builtin/remote.c index 0a56d7da66..33ba739332 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; }