From e2b9d8d181b3994c4357a2f94545046ea3f1d3ab Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 19 Jan 2009 08:26:21 +0000 Subject: 26362: avoid calling regfree() on uninitialized regex_t. --- ChangeLog | 16 +++++++++++----- Src/Modules/regex.c | 2 +- 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 - * 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 + + * 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 @@ -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) -- cgit 1.4.1