summaryrefslogtreecommitdiff
path: root/lib/libc/regex/engine.c
diff options
context:
space:
mode:
authorDiomidis Spinellis <dds@FreeBSD.org>2004-12-30 14:27:57 +0000
committerDiomidis Spinellis <dds@FreeBSD.org>2004-12-30 14:27:57 +0000
commitc7ce9e21f852b8eec580b7583c65dfcfc31de1f6 (patch)
tree1a58ad7eea86a0971b09ecd05c614d33aa5fc4df /lib/libc/regex/engine.c
parentb36aab857b5f7cbf57056755d89cfef5ec675c4d (diff)
Notes
Diffstat (limited to 'lib/libc/regex/engine.c')
-rw-r--r--lib/libc/regex/engine.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index f97a79b244d11..35bcb5a83801c 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -255,6 +255,10 @@ int eflags;
for (;;) {
endp = fast(m, start, stop, gf, gl);
if (endp == NULL) { /* a miss */
+ if (m->pmatch != NULL)
+ free((char *)m->pmatch);
+ if (m->lastpos != NULL)
+ free((char *)m->lastpos);
STATETEARDOWN(m);
return(REG_NOMATCH);
}