Commit b5ab6771 authored by Steven Luo's avatar Steven Luo Committed by Samuel Thibault
Browse files

slirp: don't crash when tcp_sockclosed() is called with a NULL tp

parent 7acbff99
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -356,6 +356,10 @@ tcp_sockclosed(struct tcpcb *tp)
	DEBUG_CALL("tcp_sockclosed");
	DEBUG_ARG("tp = %p", tp);

	if (!tp) {
		return;
	}

	switch (tp->t_state) {

	case TCPS_CLOSED:
@@ -374,7 +378,6 @@ tcp_sockclosed(struct tcpcb *tp)
		tp->t_state = TCPS_LAST_ACK;
		break;
	}
	if (tp)
	tcp_output(tp);
}