diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-10-30 18:23:17 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-10-30 18:23:17 +0100 |
commit | e0be1d605f6a219b07bc3eaa8541318074c986b6 (patch) | |
tree | 825de49437be95f52f74f4d7a29669b0648c780b | |
parent | 45d295e08cc7bd8b2dc27ed88d067eff6991d5c8 (diff) | |
download | libgit2-e0be1d605f6a219b07bc3eaa8541318074c986b6.tar.gz |
git: put NULL check at the top
-rw-r--r-- | src/transports/git.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/transports/git.c b/src/transports/git.c index 3e7e5a04f..6c6acf9c5 100644 --- a/src/transports/git.c +++ b/src/transports/git.c @@ -130,12 +130,15 @@ static int git_proto_stream_write( static void git_proto_stream_free(git_smart_subtransport_stream *stream) { - git_proto_stream *s = (git_proto_stream *)stream; - git_subtransport *t = OWNING_SUBTRANSPORT(s); + git_proto_stream *s; + git_subtransport *t; if (!stream) return; + s = (git_proto_stream *)stream; + t = OWNING_SUBTRANSPORT(s); + t->current_stream = NULL; git_stream_close(s->io); |