svn commit: r288242 - head/sys/contrib/ipfilter/netinet

Bjoern A. Zeeb bz at FreeBSD.org
Fri Sep 25 23:07:18 UTC 2015


Author: bz
Date: Fri Sep 25 23:07:17 2015
New Revision: 288242
URL: https://svnweb.freebsd.org/changeset/base/288242

Log:
  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

Modified:
  head/sys/contrib/ipfilter/netinet/ip_nat.c

Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_nat.c	Fri Sep 25 23:03:32 2015	(r288241)
+++ head/sys/contrib/ipfilter/netinet/ip_nat.c	Fri Sep 25 23:07:17 2015	(r288242)
@@ -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;
 	}


More information about the svn-src-all mailing list