diff options
author | bz <bz@FreeBSD.org> | 2015-09-25 23:07:17 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2015-09-25 23:07:17 +0000 |
commit | ede510f112e379b6dfc6618536ae876a80b31fec (patch) | |
tree | 0715b702f11f9231cdaaa53e6c6a969726f0be2b /sys/contrib | |
parent | 46022c06a161133085315ea5e2d0be7dabf5bf04 (diff) | |
download | FreeBSD-src-ede510f112e379b6dfc6618536ae876a80b31fec.zip FreeBSD-src-ede510f112e379b6dfc6618536ae876a80b31fec.tar.gz |
Compare the newly allocated array elements to NULL in order to see
if the malloc succeeded.
Spotted by: reading kernel compile time log
MFC after: 2 weeks
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_nat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 36b4fe3..9ec450b 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -8075,13 +8075,13 @@ ipf_nat_rehash(softc, t, p) * the outbound lookup table and the hash chain length for each. */ KMALLOCS(newtab[0], nat_t **, newsize * sizeof(nat_t *)); - if (newtab == NULL) { + if (newtab[0] == NULL) { error = 60063; goto badrehash; } KMALLOCS(newtab[1], nat_t **, newsize * sizeof(nat_t *)); - if (newtab == NULL) { + if (newtab[1] == NULL) { error = 60064; goto badrehash; } |