diff options
author | 2005-01-03 19:51:14 +0000 | |
---|---|---|
committer | 2005-01-03 19:51:14 +0000 | |
commit | efc4ecace19e5e9d9c533f4a1a1a1f4ee05467a2 (patch) | |
tree | 8bc48390c6494f8726ac55ea3bc1801fba7b35f9 /lib/libc/regex/engine.c | |
parent | the proclamation of the Soviet Socialist Zaurus Portablic (diff) | |
download | wireguard-openbsd-efc4ecace19e5e9d9c533f4a1a1a1f4ee05467a2.tar.xz wireguard-openbsd-efc4ecace19e5e9d9c533f4a1a1a1f4ee05467a2.zip |
Plug a mem leak. Now you can run hanoi.sed witt a lot of pegs and not
run out of mem! From FreeBSD PR 75656.
ok millert@ deraadt@
Diffstat (limited to 'lib/libc/regex/engine.c')
-rw-r--r-- | lib/libc/regex/engine.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c index 09f8cb2bce1..466a8208e88 100644 --- a/lib/libc/regex/engine.c +++ b/lib/libc/regex/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.13 2004/11/30 17:04:23 otto Exp $ */ +/* $OpenBSD: engine.c,v 1.14 2005/01/03 19:51:14 otto Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -36,7 +36,7 @@ */ #if defined(SNAMES) && defined(LIBC_SCCS) && !defined(lint) -static char enginercsid[] = "$OpenBSD: engine.c,v 1.13 2004/11/30 17:04:23 otto Exp $"; +static char enginercsid[] = "$OpenBSD: engine.c,v 1.14 2005/01/03 19:51:14 otto Exp $"; #endif /* SNAMES and LIBC_SCCS and not lint */ /* @@ -184,6 +184,8 @@ matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], for (;;) { endp = fast(m, start, stop, gf, gl); if (endp == NULL) { /* a miss */ + free(m->pmatch); + free(m->lastpos); STATETEARDOWN(m); return(REG_NOMATCH); } |