about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2009-01-19 08:26:21 +0000
committerWayne Davison <wayned@users.sourceforge.net>2009-01-19 08:26:21 +0000
commite2b9d8d181b3994c4357a2f94545046ea3f1d3ab (patch)
treed2425c07ad41efa0789a3af25f2fefbcc602d255
parent36375b59118bad3cefeda373805f6f364818b46a (diff)
downloadzsh-e2b9d8d181b3994c4357a2f94545046ea3f1d3ab.tar.gz
zsh-e2b9d8d181b3994c4357a2f94545046ea3f1d3ab.tar.xz
zsh-e2b9d8d181b3994c4357a2f94545046ea3f1d3ab.zip
26362: avoid calling regfree() on uninitialized regex_t.
-rw-r--r--ChangeLog16
-rw-r--r--Src/Modules/regex.c2
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b6e3d3d28..1c3c451bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,15 @@
 2009-01-19  Wayne Davison  <wayned@users.sourceforge.net>
 
-	* unposted: fixed compiler warnings in zcond_regex_match(),
-	including a (useless) warning about matchessz potentially
-	being used uninitialized, some signed/unsigned warnings
-	about re.re_nsub.  Split a couple compound lines too.
+	* 26362: Src/Modules/regex.c: avoid calling regfree() when the
+	regex_t "re" was not initialized.
+
+2009-01-19  Wayne Davison  <wayned@users.sourceforge.net>
+
+	* unposted: Src/Modules/regex.c: fixed a few compiler warnings
+	in zcond_regex_match(), including a (useless) warning about
+	matchessz potentially being used uninitialized and some
+	signed/unsigned warnings about re.re_nsub.  Also split a
+	couple compound lines.
 
 2009-01-19  Doug Kearns  <dougkearns@gmail.com>
 
@@ -10937,5 +10943,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4515 $                         
+* $Revision: 1.4516 $                         
 *****************************************************
diff --git a/Src/Modules/regex.c b/Src/Modules/regex.c
index 0051c6df0..8a9f3e608 100644
--- a/Src/Modules/regex.c
+++ b/Src/Modules/regex.c
@@ -120,7 +120,7 @@ zcond_regex_match(char **a, int id)
 	break;
     default:
 	DPUTS(1, "bad regex option");
-	break;
+	return 0; /* nothing to cleanup, especially not "re". */
     }
 
     if (matches)