Skip to content

Commit

Permalink
MFH: free class_name when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
tony2001 committed Feb 1, 2007
1 parent 6e8654a commit 0c84a4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/standard/incomplete_class.c
Expand Up @@ -39,14 +39,20 @@ static zend_object_handlers php_incomplete_object_handlers;
static void incomplete_class_message(zval *object, int error_type TSRMLS_DC)
{
char *class_name;
zend_bool class_name_alloced = 1;

class_name = php_lookup_class_name(object, NULL);

if (!class_name) {
class_name_alloced = 0;
class_name = "unknown";
}

php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name);

if (class_name_alloced) {
efree(class_name);
}
}
/* }}} */

Expand Down

0 comments on commit 0c84a4d

Please sign in to comment.