summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r--sapi/phpdbg/phpdbg_list.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index a2f5ff6cc5..3a7761cc64 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -289,7 +289,12 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
zend_file_handle_dtor(&fake);
dataptr->op_array = ret;
- ++*dataptr->op_array->refcount;
+ if (dataptr->op_array->refcount) {
+ ++*dataptr->op_array->refcount;
+ } else {
+ dataptr->op_array->refcount = emalloc(sizeof(uint32_t));
+ *dataptr->op_array->refcount = 2;
+ }
return ret;
}