From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 2 18:52:20 2015 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F80A75F; Fri, 2 Jan 2015 18:52:20 +0000 (UTC) Received: from svn.freebsd.org (svn.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 EF4DD1F3F; Fri, 2 Jan 2015 18:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02IqJgK075119; Fri, 2 Jan 2015 18:52:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02IqJDY075118; Fri, 2 Jan 2015 18:52:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021852.t02IqJDY075118@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 2 Jan 2015 18:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r276555 - stable/8/lib/libc/regex X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:52:20 -0000 Author: delphij Date: Fri Jan 2 18:52:18 2015 New Revision: 276555 URL: https://svnweb.freebsd.org/changeset/base/276555 Log: MFC r275930: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) Modified: stable/8/lib/libc/regex/regcomp.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/regex/regcomp.c ============================================================================== --- stable/8/lib/libc/regex/regcomp.c Fri Jan 2 18:51:47 2015 (r276554) +++ stable/8/lib/libc/regex/regcomp.c Fri Jan 2 18:52:18 2015 (r276555) @@ -1693,8 +1693,10 @@ computematchjumps(struct parse *p, struc } g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++)