summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>2000-07-02 15:58:54 +0000
committerdcs <dcs@FreeBSD.org>2000-07-02 15:58:54 +0000
commitc0e63a3b831cb64775c5f9695c5da242ab993898 (patch)
treea7da5e89ce99150513e1e962212f1ea09788f4c3 /lib/libc/regex
parent68320142fe07670510c2230987a9211d35698484 (diff)
downloadFreeBSD-src-c0e63a3b831cb64775c5f9695c5da242ab993898.zip
FreeBSD-src-c0e63a3b831cb64775c5f9695c5da242ab993898.tar.gz
Fix memory leak introduced with regcomp.c rev 1.14.
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/regfree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/regex/regfree.c b/lib/libc/regex/regfree.c
index 580fb75..cd6b3dc 100644
--- a/lib/libc/regex/regfree.c
+++ b/lib/libc/regex/regfree.c
@@ -35,6 +35,8 @@
* SUCH DAMAGE.
*
* @(#)regfree.c 8.3 (Berkeley) 3/20/94
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -76,5 +78,9 @@ regex_t *preg;
free((char *)g->setbits);
if (g->must != NULL)
free(g->must);
+ if (g->charjump != NULL)
+ free(g->charjump);
+ if (g->matchjump != NULL)
+ free(g->matchjump);
free((char *)g);
}
OpenPOWER on IntegriCloud