libc/regexp memory leak

Matthew Dillon dillon at apollo.backplane.com
Sat Jan 8 11:18:16 PST 2005


:from FreeBSD http://www.freebsd.org/cgi/query-pr.cgi?pr=75656
:
:--- /usr/src/lib/libc/regex/engine.c.orig       2005-01-08
:01:49:14.000000000 +0000
:+++ /usr/src/lib/libc/regex/engine.c    2005-01-08 01:49:42.000000000 +0000
:@@ -239,6 +239,10 @@
:        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);

    Committed!

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Submit mailing list