Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0be1d6

Browse files
committed
git: put NULL check at the top
1 parent 45d295e commit e0be1d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/transports/git.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,15 @@ static int git_proto_stream_write(
130130

131131
static void git_proto_stream_free(git_smart_subtransport_stream *stream)
132132
{
133-
git_proto_stream *s = (git_proto_stream *)stream;
134-
git_subtransport *t = OWNING_SUBTRANSPORT(s);
133+
git_proto_stream *s;
134+
git_subtransport *t;
135135

136136
if (!stream)
137137
return;
138138

139+
s = (git_proto_stream *)stream;
140+
t = OWNING_SUBTRANSPORT(s);
141+
139142
t->current_stream = NULL;
140143

141144
git_stream_close(s->io);

0 commit comments

Comments
 (0)