Skip to content

Commit 109c528

Browse files
committed
PHP-143 - Memory leak in FutureSession
1 parent 5b730c3 commit 109c528

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/src/FutureSession.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ php_driver_future_session_free(php5to7_zend_object_free *object TSRMLS_DC)
133133
efree(self->exception_message);
134134
}
135135

136+
PHP5TO7_ZVAL_MAYBE_DESTROY(self->default_session);
137+
136138
zend_object_std_dtor(&self->zval TSRMLS_CC);
137139
PHP5TO7_MAYBE_EFREE(self);
138140
}
@@ -149,6 +151,8 @@ php_driver_future_session_new(zend_class_entry *ce TSRMLS_DC)
149151
self->hash_key = NULL;
150152
self->persist = 0;
151153

154+
PHP5TO7_ZVAL_UNDEF(self->default_session);
155+
152156
PHP5TO7_ZEND_OBJECT_INIT(future_session, self, ce);
153157
}
154158

0 commit comments

Comments
 (0)