diff options
author | Antony Dovgal <tony2001@php.net> | 2007-02-01 14:07:43 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2007-02-01 14:07:43 +0000 |
commit | 0c84a4d927b1d8b5bacc6d53527b737c919cff95 (patch) | |
tree | 5e7486c126d0aeefe88931f4d183869d0fec2d0d | |
parent | 6e8654aae16ec9cca246f0fe1c863ced98249b3d (diff) | |
download | php-git-0c84a4d927b1d8b5bacc6d53527b737c919cff95.tar.gz |
MFH: free class_name when necessary
-rw-r--r-- | ext/standard/incomplete_class.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 28991abf9c..4eb33d4df1 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -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); + } } /* }}} */ |