Skip to content

Commit 85af9f7

Browse files
rscharfegitster
authored andcommitted
remote: release strbuf after use in set_url()
Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b95c8ce commit 85af9f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/remote.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,9 +1565,7 @@ static int set_url(int argc, const char **argv)
15651565
"^$", 0);
15661566
else
15671567
git_config_set(name_buf.buf, newurl);
1568-
strbuf_release(&name_buf);
1569-
1570-
return 0;
1568+
goto out;
15711569
}
15721570

15731571
/* Old URL specified. Demand that one matches. */
@@ -1590,6 +1588,8 @@ static int set_url(int argc, const char **argv)
15901588
git_config_set_multivar(name_buf.buf, newurl, oldurl, 0);
15911589
else
15921590
git_config_set_multivar(name_buf.buf, NULL, oldurl, 1);
1591+
out:
1592+
strbuf_release(&name_buf);
15931593
return 0;
15941594
}
15951595

0 commit comments

Comments
 (0)