mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 08:43:23 +00:00
Check for MGET* returning NULL and return ENOBUFS in this case.
Submitted by: Bosko Milekic <bmilekic@technokratis.com>
This commit is contained in:
parent
068b0778a3
commit
6776c7cba9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61505
@ -419,13 +419,19 @@ key_sendup(so, msg, len, target)
|
||||
while (tlen > 0) {
|
||||
if (tlen == len) {
|
||||
MGETHDR(n, M_DONTWAIT, MT_DATA);
|
||||
if (n == NULL) {
|
||||
m_freem(m);
|
||||
return ENOBUFS;
|
||||
}
|
||||
n->m_len = MHLEN;
|
||||
} else {
|
||||
MGET(n, M_DONTWAIT, MT_DATA);
|
||||
if (n == NULL) {
|
||||
m_freem(m);
|
||||
return ENOBUFS;
|
||||
}
|
||||
n->m_len = MLEN;
|
||||
}
|
||||
if (!n)
|
||||
return ENOBUFS;
|
||||
if (tlen > MCLBYTES) { /*XXX better threshold? */
|
||||
MCLGET(n, M_DONTWAIT);
|
||||
if ((n->m_flags & M_EXT) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user