iliaa           Wed Nov 26 20:08:53 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/standard       string.c 
  Log:
  MFH: Removed dead code.
  
  # This fixes memory corruption reported by valgrind.
  
  
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.36 
php-src/ext/standard/string.c:1.333.2.37
--- php-src/ext/standard/string.c:1.333.2.36    Sun Sep 28 22:23:52 2003
+++ php-src/ext/standard/string.c       Wed Nov 26 20:08:51 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.333.2.36 2003/09/29 02:23:52 moriyoshi Exp $ */
+/* $Id: string.c,v 1.333.2.37 2003/11/27 01:08:51 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -861,7 +861,6 @@
 {
        zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
        int argc = ZEND_NUM_ARGS();
-       int arg1_separated = 0, arg2_separated = 0, delim_needs_dtor = 0;
 
        if (argc < 1 || argc > 2 ||
                zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
@@ -879,19 +878,15 @@
                ZVAL_STRINGL(delim, _IMPL_EMPTY, sizeof(_IMPL_EMPTY) - 1, 0);
 
                SEPARATE_ZVAL(arg1);
-               arg1_separated = 1;
-               delim_needs_dtor = 1;   
                arr = *arg1;
        } else {
                if (Z_TYPE_PP(arg1) == IS_ARRAY) {
                        SEPARATE_ZVAL(arg1);
-                       arg1_separated = 1;
                        arr = *arg1;
                        convert_to_string_ex(arg2);
                        delim = *arg2;
                } else if (Z_TYPE_PP(arg2) == IS_ARRAY) {
                        SEPARATE_ZVAL(arg2);
-                       arg2_separated = 1;
                        arr = *arg2;
                        convert_to_string_ex(arg1);
                        delim = *arg1;
@@ -903,13 +898,7 @@
 
        php_implode(delim, arr, return_value);
 
-       if (arg1 != NULL && arg1_separated) {
-               zval_ptr_dtor(arg1);
-       }
-       if (arg2 != NULL && arg2_separated) {
-               zval_ptr_dtor(arg2);
-       }
-       if (delim_needs_dtor) {
+       if (argc == 1) {
                FREE_ZVAL(delim);
        }
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to