]> granicus.if.org Git - php/commitdiff
free class_name when necessary
authorAntony Dovgal <tony2001@php.net>
Thu, 1 Feb 2007 14:07:03 +0000 (14:07 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 1 Feb 2007 14:07:03 +0000 (14:07 +0000)
ext/standard/incomplete_class.c

index 20ccc0f9b76617f52dba0cd387bf80010257c6aa..5b3a9b392940c20faa7109c1a90827705734e7d1 100644 (file)
@@ -39,15 +39,21 @@ static zend_object_handlers php_incomplete_object_handlers;
 static void incomplete_class_message(zval *object, int error_type TSRMLS_DC)
 {
        zstr class_name;
+       zend_bool class_name_alloced = 1;
 
        class_name = php_lookup_class_name(object, NULL);
        
        /* FIXME: Unicode support??? */
        if (!class_name.s) {
+               class_name_alloced = 0;
                class_name.s = "unknown";
        }
        
        php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name);
+
+       if (class_name_alloced) {
+               efree(class_name.v);
+       }
 }
 /* }}} */