]> granicus.if.org Git - php/commitdiff
Avoid multiple allocations of the same key in different processes
authorDmitry Stogov <dmitry@zend.com>
Mon, 10 Jun 2013 07:43:03 +0000 (11:43 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 10 Jun 2013 07:43:03 +0000 (11:43 +0400)
ext/opcache/ZendAccelerator.c

index 212e1e68d0c8f90b2cc1ead1eee580c05e5c76ed..922fc91d27a5354830484dadd25e2022a8f64f02 100644 (file)
@@ -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);