summaryrefslogtreecommitdiff
path: root/Zend/zend_stack.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2010-07-06 16:09:43 +0000
committerDmitry Stogov <dmitry@php.net>2010-07-06 16:09:43 +0000
commit8054458fb84119439959c7928dca26ca701212ba (patch)
tree6069c9c2e0cd3cff185585813aeeead9576e2aaf /Zend/zend_stack.c
parent3ea3bbaca318c0a77d0c73166d79073d37d76f13 (diff)
downloadphp-git-8054458fb84119439959c7928dca26ca701212ba.tar.gz
zend_stack initialization is delayed before the actual usage
Diffstat (limited to 'Zend/zend_stack.c')
-rw-r--r--Zend/zend_stack.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c
index 266faae362..1c6b066507 100644
--- a/Zend/zend_stack.c
+++ b/Zend/zend_stack.c
@@ -25,13 +25,9 @@
ZEND_API int zend_stack_init(zend_stack *stack)
{
stack->top = 0;
- stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE);
- if (!stack->elements) {
- return FAILURE;
- } else {
- stack->max = STACK_BLOCK_SIZE;
- return SUCCESS;
- }
+ stack->max = 0;
+ stack->elements = NULL;
+ return SUCCESS;
}
ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size)