summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authordds <dds@FreeBSD.org>2004-12-30 14:27:57 +0000
committerdds <dds@FreeBSD.org>2004-12-30 14:27:57 +0000
commit8cca71873f5af1ac6a4adde55a506a0c7bddf3e0 (patch)
tree1a58ad7eea86a0971b09ecd05c614d33aa5fc4df /lib/libc
parent44386c77197d144893b544e3cf8a85f5e37a091f (diff)
downloadFreeBSD-src-8cca71873f5af1ac6a4adde55a506a0c7bddf3e0.zip
FreeBSD-src-8cca71873f5af1ac6a4adde55a506a0c7bddf3e0.tar.gz
Plug memory leak.
PR: bin/75656 MFC after: 2 weeks
Diffstat (limited to 'lib/libc')
-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 f97a79b..35bcb5a 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);
}
OpenPOWER on IntegriCloud