]> granicus.if.org Git - php/commitdiff
Free vars before calling E_ERROR.
authorIlia Alshanetsky <iliaa@php.net>
Thu, 20 May 2004 00:11:23 +0000 (00:11 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 20 May 2004 00:11:23 +0000 (00:11 +0000)
ext/pfpro/pfpro.c

index 9b8005a9fe9f010195730459fc70db2816a6f7ec..a493ce3f0d1fb89227c3e56f63f3839c55d2dd18 100644 (file)
@@ -328,14 +328,14 @@ PHP_FUNCTION(pfpro_process)
        args = (zval ***) safe_emalloc(sizeof(zval **), ZEND_NUM_ARGS(), 0);
 
        if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
+               efree(args);
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to read parameters in pfpro_process()");
-               efree(args);
                RETURN_FALSE;
        }
 
        if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
+               efree(args);
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "First parameter to pfpro_process() must be an array");
-               efree(args);
                RETURN_FALSE;
        }
 
@@ -418,11 +418,11 @@ PHP_FUNCTION(pfpro_process)
                                        break;
 
                                default:
-                                       php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array keys must be strings or integers");
                                        if (parmlist) {
                                                efree(parmlist);
                                        }
                                        efree(args);
+                                       php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array keys must be strings or integers");
                                        RETURN_FALSE;
                        }
 
@@ -464,11 +464,11 @@ PHP_FUNCTION(pfpro_process)
                                        break;
 
                                default:
-                                       php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array values must be strings, ints or floats");
                                        if (parmlist) {
                                                efree(parmlist);
                                        }
                                        efree(args);
+                                       php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array values must be strings, ints or floats");
                                        RETURN_FALSE;
                        }
                        zend_hash_move_forward(target_hash);