Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
submodule--helper: plug mem leak in print_default_remote
author
Stefan Beller
<sbeller@google.com>
Wed, 30 May 2018 17:03:02 +0000
(10:03 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 1 Jun 2018 05:52:47 +0000
(14:52 +0900)
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>
builtin/submodule--helper.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
09427e8
)
diff --git
a/builtin/submodule--helper.c
b/builtin/submodule--helper.c
index bd250ca2164b31356fb42406351761cd2381d115..7a752dbf9db65dfccb828cc3890340212a63bc82 100644
(file)
--- a/
builtin/submodule--helper.c
+++ b/
builtin/submodule--helper.c
@@
-55,7
+55,7
@@
static char *get_default_remote(void)
static int print_default_remote(int argc, const char **argv, const char *prefix)
{
- c
onst c
har *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;
}