From 23a9bb09baa504f20929c150b184b6c032cfc251 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Jun 2013 11:43:03 +0400 Subject: [PATCH] Avoid multiple allocations of the same key in different processes --- ext/opcache/ZendAccelerator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 212e1e68d0c..922fc91d27a 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2583,7 +2583,9 @@ static int accel_startup(zend_extension *extension) ZCG(include_path_key) = NULL; if (ZCG(include_path) && *ZCG(include_path)) { ZCG(include_path_len) = strlen(ZCG(include_path)); - if (!zend_accel_hash_is_full(&ZCSG(include_paths))) { + ZCG(include_path_key) = zend_accel_hash_find(&ZCSG(include_paths), ZCG(include_path), ZCG(include_path_len) + 1); + if (!ZCG(include_path_key) && + !zend_accel_hash_is_full(&ZCSG(include_paths))) { char *key; zend_shared_alloc_lock(TSRMLS_C);