summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_file_cache.c
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2016-06-27 07:42:49 +0100
committerDavid Carlier <devnexen@gmail.com>2016-06-27 07:44:21 +0100
commit85e985f191c228cb6b119ebe223d682c9166fdc2 (patch)
tree108e0d17ee6b4929f2f1a057e3da4f62fc307781 /ext/opcache/zend_file_cache.c
parent8de8636a2b6dc331486284f1f037259bb7347768 (diff)
downloadphp-git-85e985f191c228cb6b119ebe223d682c9166fdc2.tar.gz
couple of resource leaks fixes and use after free's
Diffstat (limited to 'ext/opcache/zend_file_cache.c')
-rw-r--r--ext/opcache/zend_file_cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index 6ac4f0e35f..6d34851352 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -791,6 +791,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
if (writev(fd, vec, 3) != (ssize_t)(sizeof(info) + script->size + info.str_size)) {
zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot write to file '%s'\n", filename);
zend_string_release((zend_string*)ZCG(mem));
+ close(fd);
efree(mem);
unlink(filename);
efree(filename);
@@ -804,6 +805,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
) {
zend_accel_error(ACCEL_LOG_WARNING, "opcache cannot write to file '%s'\n", filename);
zend_string_release((zend_string*)ZCG(mem));
+ close(fd);
efree(mem);
unlink(filename);
efree(filename);