Index: trunk/php/wmerrors/wmerrors.c |
— | — | @@ -165,7 +165,9 @@ |
166 | 166 | |
167 | 167 | /* Pass through */ |
168 | 168 | old_error_cb(type, new_filename.c, error_lineno, format, args); |
169 | | - smart_str_free(&new_filename); |
| 169 | + |
| 170 | + /* Note: old_error_cb() may not return, in which case there will be no explicit free of new_filename */ |
| 171 | + smart_str_free(&old_error_cb); |
170 | 172 | } |
171 | 173 | |
172 | 174 | /* Obtain a concisely formatted backtrace */ |
— | — | @@ -179,10 +181,13 @@ |
180 | 182 | ALLOC_INIT_ZVAL(trace); |
181 | 183 | zend_fetch_debug_backtrace(trace, 0, 0 TSRMLS_CC); |
182 | 184 | |
183 | | - if (!trace || Z_TYPE_P(trace) != IS_ARRAY) { |
| 185 | + if (Z_TYPE_P(trace) != IS_ARRAY) { |
184 | 186 | /* Not supposed to happen */ |
| 187 | + zval_dtor(trace); |
| 188 | + FREE_ZVAL(trace); |
185 | 189 | return; |
186 | 190 | } |
| 191 | + |
187 | 192 | zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(trace), &pos); |
188 | 193 | while (zend_hash_get_current_data_ex(Z_ARRVAL_P(trace), (void **)&entry, &pos) == SUCCESS) { |
189 | 194 | if (!entry || !*entry || Z_TYPE_PP(entry) != IS_ARRAY) { |