From 78ea9ed121f35501cbc7843c15a57987a195e73d Mon Sep 17 00:00:00 2001 From: Xuefer Date: Sun, 10 Dec 2006 08:14:46 +0000 Subject: [PATCH] avoid double free on php hit git-svn-id: svn://svn.lighttpd.net/xcache/trunk@322 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- xcache.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xcache.c b/xcache.c index 6c5464d..00c7bed 100644 --- a/xcache.c +++ b/xcache.c @@ -1315,8 +1315,10 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / goto err_aftersandbox; } - xc_free_php(&php TSRMLS_CC); - xc_sandbox_free(&sandbox, 0 TSRMLS_CC); + if (newlycompiled) { + xc_free_php(&php TSRMLS_CC); + xc_sandbox_free(&sandbox, 0 TSRMLS_CC); + } if (stored_xce) { if (op_array) { @@ -1333,8 +1335,10 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / return op_array; err_aftersandbox: - xc_free_php(&php TSRMLS_CC); - xc_sandbox_free(&sandbox, 0 TSRMLS_CC); + if (newlycompiled) { + xc_free_php(&php TSRMLS_CC); + xc_sandbox_free(&sandbox, 0 TSRMLS_CC); + } if (catched) { cache->compiling = 0;