From 8cca71873f5af1ac6a4adde55a506a0c7bddf3e0 Mon Sep 17 00:00:00 2001 From: dds Date: Thu, 30 Dec 2004 14:27:57 +0000 Subject: Plug memory leak. PR: bin/75656 MFC after: 2 weeks --- lib/libc/regex/engine.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libc/regex/engine.c') 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); } -- cgit v1.1