зеркало из https://github.com/microsoft/git.git
submodule--helper: plug mem leak in print_default_remote
Signed-off-by: Stefan Beller <sbeller@google.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> [jc: no need for remote to be const char *] Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
09427e8366
Коммит
e6be8e2f9f
|
@ -55,7 +55,7 @@ static char *get_default_remote(void)
|
||||||
|
|
||||||
static int print_default_remote(int argc, const char **argv, const char *prefix)
|
static int print_default_remote(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
const char *remote;
|
char *remote;
|
||||||
|
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
die(_("submodule--helper print-default-remote takes no arguments"));
|
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)
|
if (remote)
|
||||||
printf("%s\n", remote);
|
printf("%s\n", remote);
|
||||||
|
|
||||||
|
free(remote);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче