DragonFly BSD
DragonFly submit List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: libc/regexp memory leak


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 8 Jan 2005 11:17:10 -0800 (PST)

: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@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]