From 154e80750e93e23d4f4def5631344ca73db70888 Mon Sep 17 00:00:00 2001 From: Breno Silva Date: Sun, 27 Jan 2013 21:02:47 -0400 Subject: [PATCH] Nginx: fixed crash in pcre --- apache2/msc_pcre.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apache2/msc_pcre.c b/apache2/msc_pcre.c index 8ca588a9..3393493b 100644 --- a/apache2/msc_pcre.c +++ b/apache2/msc_pcre.c @@ -21,7 +21,11 @@ static apr_status_t msc_pcre_cleanup(msc_regex_t *regex) { if (regex != NULL) { if (regex->pe != NULL) { +#if defined(VERSION_NGINX) + pcre_free(regex->pe); +#else free(regex->pe); +#endif regex->pe = NULL; } if (regex->re != NULL) { @@ -71,7 +75,11 @@ void *msc_pregcomp_ex(apr_pool_t *pool, const char *pattern, int options, /* Setup the pcre_extra record if pcre_study did not already do it */ if (pe == NULL) { +#if defined(VERSION_NGINX) + pe = pcre_malloc(sizeof(pcre_extra)); +#else pe = malloc(sizeof(pcre_extra)); +#endif if (pe == NULL) { return NULL; }