From: Dmitry Stogov Date: Mon, 10 Jun 2013 07:43:03 +0000 (+0400) Subject: Avoid multiple allocations of the same key in different processes X-Git-Tag: php-5.5.0~29^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23a9bb09baa504f20929c150b184b6c032cfc251;p=php Avoid multiple allocations of the same key in different processes --- diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 212e1e68d0..922fc91d27 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);