summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2011-06-20 09:40:06 +0200
committerJunio C Hamano <gitster@pobox.com>2011-06-20 14:27:36 -0700
commitdc4cd767108532161d27554162a8742f5b607eb8 (patch)
tree605e8af6e513dbe39435b256b3f8b164911a8d6d /remote-curl.c
parent28eb1afec90fab398fc58a1d6119b9e99a733f87 (diff)
downloadgit-dc4cd767108532161d27554162a8742f5b607eb8.tar.gz
plug a few coverity-spotted leaks
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 17d8a9b377..b5be25ce96 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -811,19 +811,21 @@ static void parse_push(struct strbuf *buf)
strbuf_reset(buf);
if (strbuf_getline(buf, stdin, '\n') == EOF)
- return;
+ goto free_specs;
if (!*buf->buf)
break;
} while (1);
if (push(nr_spec, specs))
exit(128); /* error already reported */
- for (i = 0; i < nr_spec; i++)
- free(specs[i]);
- free(specs);
printf("\n");
fflush(stdout);
+
+ free_specs:
+ for (i = 0; i < nr_spec; i++)
+ free(specs[i]);
+ free(specs);
}
int main(int argc, const char **argv)