From owner-svn-src-all@freebsd.org Tue Jan 24 07:48:37 2017 Return-Path: Delivered-To: svn-src-all@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 F1C2ECBF017; Tue, 24 Jan 2017 07:48:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B918F798; Tue, 24 Jan 2017 07:48:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0O7makI084871; Tue, 24 Jan 2017 07:48:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0O7man7084870; Tue, 24 Jan 2017 07:48:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701240748.v0O7man7084870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 24 Jan 2017 07:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312683 - head/usr.bin/mail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2017 07:48:38 -0000 Author: delphij Date: Tue Jan 24 07:48:36 2017 New Revision: 312683 URL: https://svnweb.freebsd.org/changeset/base/312683 Log: Don't reference NULL pointer. MFC after: 2 weeks Modified: head/usr.bin/mail/popen.c Modified: head/usr.bin/mail/popen.c ============================================================================== --- head/usr.bin/mail/popen.c Tue Jan 24 05:06:52 2017 (r312682) +++ head/usr.bin/mail/popen.c Tue Jan 24 07:48:36 2017 (r312683) @@ -303,7 +303,7 @@ findchild(pid_t pid, int dont_alloc) cpp = &(*cpp)->link) ; if (*cpp == NULL) { - if (dont_alloc) + if (dont_alloc) return(NULL); if (child_freelist) { *cpp = child_freelist; @@ -344,6 +344,8 @@ sigchild(int signo __unused) save_errno = errno; while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { cp = findchild(pid, 1); + if (cp == NULL) + continue; if (cp->free) delchild(cp); else {