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
+2
View File
@@ -6705,8 +6705,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
} else { } else {
m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
0, M_NOWAIT, 1, MT_DATA); 0, M_NOWAIT, 1, MT_DATA);
if (m != NULL) {
SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
} }
}
if (m != NULL) { if (m != NULL) {
struct sctp_paramhdr *ph; struct sctp_paramhdr *ph;