diff options
author | delphij <delphij@FreeBSD.org> | 2015-01-02 18:31:12 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-01-02 18:31:12 +0000 |
commit | b1a28017550c1fbe19238f9dc27171723f917d1a (patch) | |
tree | 076d895d0a0c4f68fa99106a84f7b9f35fd83cae /lib/libc/regex/regcomp.c | |
parent | 54309b420b40263e94a001e302d6a2d1269d391d (diff) | |
download | FreeBSD-src-b1a28017550c1fbe19238f9dc27171723f917d1a.zip FreeBSD-src-b1a28017550c1fbe19238f9dc27171723f917d1a.tar.gz |
MFC r275930:
Plug a memory leak.
Obtained from: DragonFlyBSD (commit 5119ece)
Diffstat (limited to 'lib/libc/regex/regcomp.c')
-rw-r--r-- | lib/libc/regex/regcomp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index a01bb95..2ecb88c 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1716,8 +1716,10 @@ computematchjumps(struct parse *p, struct re_guts *g) } 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++) |