From owner-svn-src-head@freebsd.org Fri Sep 25 23:07:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC382A0801F; Fri, 25 Sep 2015 23:07:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD6981CD7; Fri, 25 Sep 2015 23:07:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8PN7HWc098828; Fri, 25 Sep 2015 23:07:17 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8PN7HEP098827; Fri, 25 Sep 2015 23:07:17 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201509252307.t8PN7HEP098827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 25 Sep 2015 23:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288242 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2015 23:07:18 -0000 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; }