]> granicus.if.org Git - php/commitdiff
Fix leak on systems where alloca isn't really alloca.
authorWez Furlong <wez@php.net>
Wed, 26 May 2004 22:19:44 +0000 (22:19 +0000)
committerWez Furlong <wez@php.net>
Wed, 26 May 2004 22:19:44 +0000 (22:19 +0000)
Zend/zend_object_handlers.c

index 7d2a1036ce2ec5864049a5f3e0df9d2ccd14c144..d7f57a8d96814a3d72c2ec5bad6b04df73111b2a 100644 (file)
@@ -671,6 +671,7 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
                
        zobj = Z_OBJ_P(object);
        if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) {
+               free_alloca(lc_method_name);
                if (zobj->ce->__call) {
                        zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
                        call_user_call->type = ZEND_INTERNAL_FUNCTION;
@@ -681,7 +682,6 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
                        call_user_call->fn_flags = 0;
                        call_user_call->function_name = estrndup(method_name, method_len);
 
-                       free_alloca(lc_method_name);
                        return (union _zend_function *)call_user_call;
                } else {
                        return NULL;