Skip to content

Commit e19f0e8

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix php_pcre_mutex_free()
2 parents aba89f5 + 6dcc0b8 commit e19f0e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/pcre/php_pcre.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ ZEND_TLS zend_bool mdata_used = 0;
8383
ZEND_TLS uint8_t pcre2_init_ok = 0;
8484
#if defined(ZTS) && defined(HAVE_PCRE_JIT_SUPPORT)
8585
static MUTEX_T pcre_mt = NULL;
86-
#define php_pcre_mutex_alloc() if (tsrm_is_main_thread() && !pcre_mt) pcre_mt = tsrm_mutex_alloc();
87-
#define php_pcre_mutex_free() if (tsrm_is_main_thread() && pcre_mt) tsrm_mutex_free(pcre_mt); pcre_mt = NULL;
86+
#define php_pcre_mutex_alloc() \
87+
if (tsrm_is_main_thread() && !pcre_mt) pcre_mt = tsrm_mutex_alloc();
88+
#define php_pcre_mutex_free() \
89+
if (tsrm_is_main_thread() && pcre_mt) { tsrm_mutex_free(pcre_mt); pcre_mt = NULL; }
8890
#define php_pcre_mutex_lock() tsrm_mutex_lock(pcre_mt);
8991
#define php_pcre_mutex_unlock() tsrm_mutex_unlock(pcre_mt);
9092
#else

0 commit comments

Comments
 (0)