From owner-svn-src-stable@FreeBSD.ORG Fri Jan 2 18:51:48 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7597B62C; Fri, 2 Jan 2015 18:51:48 +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 613901F28; Fri, 2 Jan 2015 18:51:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02Ipmel074936; Fri, 2 Jan 2015 18:51:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Ipmlg074935; Fri, 2 Jan 2015 18:51:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201501021851.t02Ipmlg074935@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:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276554 - stable/9/lib/libc/regex X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 18:51:48 -0000 Author: delphij Date: Fri Jan 2 18:51:47 2015 New Revision: 276554 URL: https://svnweb.freebsd.org/changeset/base/276554 Log: MFC r275930: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) Modified: stable/9/lib/libc/regex/regcomp.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/regex/regcomp.c ============================================================================== --- stable/9/lib/libc/regex/regcomp.c Fri Jan 2 18:50:18 2015 (r276553) +++ stable/9/lib/libc/regex/regcomp.c Fri Jan 2 18:51:47 2015 (r276554) @@ -1699,8 +1699,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++)