提交 e6be8e2f 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

submodule--helper: plug mem leak in print_default_remote

Signed-off-by: NStefan Beller <sbeller@google.com>
Acked-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
[jc: no need for remote to be const char *]
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 09427e83
......@@ -55,7 +55,7 @@ static char *get_default_remote(void)
static int print_default_remote(int argc, const char **argv, const char *prefix)
{
const char *remote;
char *remote;
if (argc != 1)
die(_("submodule--helper print-default-remote takes no arguments"));
......@@ -64,6 +64,7 @@ static int print_default_remote(int argc, const char **argv, const char *prefix)
if (remote)
printf("%s\n", remote);
free(remote);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册