You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/27 18:09:30 UTC

svn commit: r808480 - /commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c

Author: mturk
Date: Thu Aug 27 16:09:29 2009
New Revision: 808480

URL: http://svn.apache.org/viewvc?rev=808480&view=rev
Log:
Merge from FreeBSD

Modified:
    commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c

Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c?rev=808480&r1=808479&r2=808480&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c Thu Aug 27 16:09:29 2009
@@ -159,8 +159,10 @@
 	for (;;) {
 		endp = fast(m, start, stop, gf, gl);
 		if (endp == NULL) {		/* a miss */
-			free(m->pmatch);
-			free(m->lastpos);
+			if (m->pmatch != NULL)
+				free(m->pmatch);
+			if (m->lastpos != NULL)
+				free(m->lastpos);
 			STATETEARDOWN(m);
 			return(REG_NOMATCH);
 		}
@@ -949,7 +951,7 @@
 	(void)fprintf(d, "\n");
 }
 
-/* 
+/*
  - at - print current situation
  */
 static void