Skip to content

Commit e249836

Browse files
laruencesmalyshev
authored andcommitted
Fixed res leak
1 parent 789fb16 commit e249836

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Zend/zend_exceptions.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,14 @@ ZEND_METHOD(exception, getTraceAsString)
587587

588588
DEFAULT_0_PARAMS;
589589

590-
res = estrdup("");
591-
str = &res;
592-
593590
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
594591
if(Z_TYPE_P(trace) != IS_ARRAY) {
595592
RETURN_FALSE;
596593
}
594+
595+
res = estrdup("");
596+
str = &res;
597+
597598
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)_build_trace_string, 3, str, len, &num);
598599

599600
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);

0 commit comments

Comments
 (0)