sctp: add missing check

If memory allocation fails, m is NULL. Since this is possible,
check for it.
Reported by:	Coverity Scan
CID:		1086866
MFC after:	3 days
This commit is contained in:
Michael Tuexen 2024-05-08 23:01:06 +02:00
parent f1612e7087
commit 3d40cc7ab8

View file

@ -6705,7 +6705,9 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
} else {
m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
0, M_NOWAIT, 1, MT_DATA);
SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
if (m != NULL) {
SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
}
}
if (m != NULL) {
struct sctp_paramhdr *ph;