Use m_get2() to get mbuf of appropriate size.
Sponsored by: Nginx, Inc.
This commit is contained in:
parent
82c4432765
commit
67a9428179
@ -459,9 +459,7 @@ xdr_string_encode(char *str, int len)
|
||||
if (mlen > MCLBYTES) /* If too big, we just can't do it. */
|
||||
return (NULL);
|
||||
|
||||
m = m_get(M_WAITOK, MT_DATA);
|
||||
if (mlen > MLEN)
|
||||
MCLGET(m, M_WAITOK);
|
||||
m = m_get2(M_WAITOK, MT_DATA, 0, mlen);
|
||||
xs = mtod(m, struct xdr_string *);
|
||||
m->m_len = mlen;
|
||||
xs->len = txdr_unsigned(len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user