summaryrefslogtreecommitdiff
path: root/builtin/push.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-03-31 23:56:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-02 16:49:24 (GMT)
commit54cc8aca60e474e637e9d71b57ee2c6f1fb197e6 (patch)
tree8309892edee66ddeb419aba38ea51d36942e3ac4 /builtin/push.c
parentb14f27f91770e0f99f64135348977a0ce1c7993a (diff)
downloadgit-54cc8aca60e474e637e9d71b57ee2c6f1fb197e6.zip
git-54cc8aca60e474e637e9d71b57ee2c6f1fb197e6.tar.gz
git-54cc8aca60e474e637e9d71b57ee2c6f1fb197e6.tar.bz2
push: unmark a local variable as static
There isn't any obvious reason for the 'struct string_list push_options' and 'struct string_list_item *item' to be marked as static, so unmark them as being static. Also, clear the push_options string_list to prevent memory leaking. Signed-off-by: Brandon Williams <bmwill@google.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 5c22e9f..a597759 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -510,8 +510,8 @@ int cmd_push(int argc, const char **argv, const char *prefix)
int push_cert = -1;
int rc;
const char *repo = NULL; /* default repository */
- static struct string_list push_options = STRING_LIST_INIT_DUP;
- static struct string_list_item *item;
+ struct string_list push_options = STRING_LIST_INIT_DUP;
+ const struct string_list_item *item;
struct option options[] = {
OPT__VERBOSITY(&verbosity),
@@ -584,6 +584,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
die(_("push options must not have new line characters"));
rc = do_push(repo, flags, &push_options);
+ string_list_clear(&push_options, 0);
if (rc == -1)
usage_with_options(push_usage, options);
else