git: put NULL check at the top

This commit is contained in:
Carlos Martín Nieto 2015-10-30 18:23:17 +01:00
parent 45d295e08c
commit e0be1d605f

View File

@ -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);