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;
        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to