From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:43:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E586106564A; Tue, 28 Dec 2010 02:43:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBBA8FC13; Tue, 28 Dec 2010 02:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2hTA6044021; Tue, 28 Dec 2010 02:43:29 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2hTIg044019; Tue, 28 Dec 2010 02:43:29 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280243.oBS2hTIg044019@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216751 - stable/8/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 28 Dec 2010 02:43:29 -0000 Author: kevlo Date: Tue Dec 28 02:43:28 2010 New Revision: 216751 URL: http://svn.freebsd.org/changeset/base/216751 Log: MFC r216431: Check return value of malloc(). Reviewed by: hselasky Modified: stable/8/lib/libusb/libusb20_compat01.c Modified: stable/8/lib/libusb/libusb20_compat01.c ============================================================================== --- stable/8/lib/libusb/libusb20_compat01.c Tue Dec 28 02:25:32 2010 (r216750) +++ stable/8/lib/libusb/libusb20_compat01.c Tue Dec 28 02:43:28 2010 (r216751) @@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_confi /* allocate memory for our configuration */ ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } /* "currifcw" must be first, hence this pointer is freed */ ps.b.currifcw = (void *)(ptr);