From owner-svn-src-all@freebsd.org Fri Dec 18 17:52:10 2015 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 43998A4B967; Fri, 18 Dec 2015 17:52:10 +0000 (UTC) (envelope-from jhb@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 126EB1E64; Fri, 18 Dec 2015 17:52:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIHq9aA069910; Fri, 18 Dec 2015 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIHq9QN069909; Fri, 18 Dec 2015 17:52:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512181752.tBIHq9QN069909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292443 - head/usr.sbin/boot0cfg 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.20 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: Fri, 18 Dec 2015 17:52:10 -0000 Author: jhb Date: Fri Dec 18 17:52:08 2015 New Revision: 292443 URL: https://svnweb.freebsd.org/changeset/base/292443 Log: Fix the precious change to check the pointer returned by malloc(). Submitted by: luke Pointy hat to: jhb Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Fri Dec 18 17:39:54 2015 (r292442) +++ head/usr.sbin/boot0cfg/boot0cfg.c Fri Dec 18 17:52:08 2015 (r292443) @@ -337,7 +337,7 @@ read_mbr(const char *disk, u_int8_t **mb return (mbr_size); } *mbr = malloc(sizeof(buf)); - if (mbr == NULL) + if (*mbr == NULL) errx(1, "%s: unable to allocate MBR buffer", disk); memcpy(*mbr, buf, sizeof(buf)); close(fd);