Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 2015 23:07:17 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288242 - head/sys/contrib/ipfilter/netinet
Message-ID:  <201509252307.t8PN7HEP098827@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509252307.t8PN7HEP098827>