r82265 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82264‎ | r82265 | r82266 >
Date:17:47, 16 February 2011
Author:platonides
Status:deferred
Tags:
Comment:
Document that smart_str_free() could not be called.
Modified paths:
  • /trunk/php/wmerrors/wmerrors.c (modified) (history)

Diff [purge]

Index: trunk/php/wmerrors/wmerrors.c
@@ -165,7 +165,9 @@
166166
167167 /* Pass through */
168168 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);
170172 }
171173
172174 /* Obtain a concisely formatted backtrace */
@@ -179,10 +181,13 @@
180182 ALLOC_INIT_ZVAL(trace);
181183 zend_fetch_debug_backtrace(trace, 0, 0 TSRMLS_CC);
182184
183 - if (!trace || Z_TYPE_P(trace) != IS_ARRAY) {
 185+ if (Z_TYPE_P(trace) != IS_ARRAY) {
184186 /* Not supposed to happen */
 187+ zval_dtor(trace);
 188+ FREE_ZVAL(trace);
185189 return;
186190 }
 191+
187192 zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(trace), &pos);
188193 while (zend_hash_get_current_data_ex(Z_ARRVAL_P(trace), (void **)&entry, &pos) == SUCCESS) {
189194 if (!entry || !*entry || Z_TYPE_PP(entry) != IS_ARRAY) {

Status & tagging log