Since callers of m_getcl() assume it always allocates a cluster, check

that MGETCL() actually succeeded before returning the mbuf.
This commit is contained in:
scw 2004-01-16 09:50:40 +00:00
parent c89e32bbcc
commit 58987a0a55
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipsec_osdep.h,v 1.4 2003/11/11 20:25:26 jonathan Exp $ */
/* $NetBSD: ipsec_osdep.h,v 1.5 2004/01/16 09:50:40 scw Exp $ */
#ifndef NETIPSEC_OSDEP_H
#define NETIPSEC_OSDEP_H
@ -118,6 +118,10 @@ m_getcl(int how, short type, int flags)
return NULL;
MCLGET(mp, how);
if ((mp->m_flags & M_EXT) == 0) {
m_free(mp);
mp = NULL;
}
return mp;
}
#endif /* __NetBSD__ */