From e0be1d605f6a219b07bc3eaa8541318074c986b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 30 Oct 2015 18:23:17 +0100 Subject: [PATCH] git: put NULL check at the top --- src/transports/git.c | 7 +++++-- 1 file 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);