diff options
author | Dmitry Stogov <dmitry@php.net> | 2010-07-06 16:09:43 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2010-07-06 16:09:43 +0000 |
commit | 8054458fb84119439959c7928dca26ca701212ba (patch) | |
tree | 6069c9c2e0cd3cff185585813aeeead9576e2aaf /Zend/zend_stack.c | |
parent | 3ea3bbaca318c0a77d0c73166d79073d37d76f13 (diff) | |
download | php-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.c | 10 |
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) |