Date: Fri, 19 Dec 2014 06:48:48 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275930 - head/lib/libc/regex Message-ID: <201412190648.sBJ6mmv5059708@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Fri Dec 19 06:48:47 2014 New Revision: 275930 URL: https://svnweb.freebsd.org/changeset/base/275930 Log: Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece) MFC after: 2 weeks Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Fri Dec 19 01:41:51 2014 (r275929) +++ head/lib/libc/regex/regcomp.c Fri Dec 19 06:48:47 2014 (r275930) @@ -1716,8 +1716,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++)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412190648.sBJ6mmv5059708>