]> granicus.if.org Git - php/commitdiff
fix a few compiler warnings (mostly use of unitialized values)
authorNuno Lopes <nlopess@php.net>
Sat, 29 Sep 2007 11:18:42 +0000 (11:18 +0000)
committerNuno Lopes <nlopess@php.net>
Sat, 29 Sep 2007 11:18:42 +0000 (11:18 +0000)
ext/openssl/xp_ssl.c
ext/standard/var_unserializer.c
ext/standard/var_unserializer.re
main/php_variables.c
sapi/cli/php_cli_readline.c

index 842b9e547dc8e3574c23f7ccd72b0812e91ec354..3e276c4f979233a6ecc1637e45eb2e3f50509d19 100644 (file)
@@ -490,8 +490,8 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
                                                                                zend_list_insert(mycert,
                                                                                        php_openssl_get_x509_list_id()));
                                                                add_next_index_zval(arr, zcert);
-                                                       }
                                                                efree(zcert);
+                                                       }
 
                                                } else {
                                                        ZVAL_NULL(arr);
index 934dfb451486de49f9eb7319b28aca74d1153f90..4802fd5a8e8f5a4e8c8df3b28c3b5799efcdc414 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.12.1 on Mon Aug  6 21:32:14 2007 */
+/* Generated by re2c 0.12.0 on Sat Sep 29 11:44:15 2007 */
 #line 1 "ext/standard/var_unserializer.re"
 /*
   +----------------------------------------------------------------------+
@@ -334,7 +334,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
        (*p) += 2;
 
        if (datalen < 0 || (*p) + datalen >= max) {
-               zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, max - (*p));
+               zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p)));
                return 0;
        }
 
index a54da2ec6760edaa44efc10e9f14b4f19dde2cc1..bb8eefea01258feb05386dd5bfbee09312beddf1 100644 (file)
@@ -338,7 +338,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
        (*p) += 2;
 
        if (datalen < 0 || (*p) + datalen >= max) {
-               zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, max - (*p));
+               zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p)));
                return 0;
        }
 
index ef6aa366933c1b056a92b82d03d4b5522c6fde05..bf52dae0e83019c4af2a135740d5d4dea62ee223 100644 (file)
@@ -130,11 +130,12 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra
 
                                if (track_vars_array) {
                                        ht = Z_ARRVAL_P(track_vars_array);
+                                       zend_hash_del(ht, var, var_len + 1);
                                } else if (PG(register_globals)) {
                                        ht = EG(active_symbol_table);
+                                       zend_hash_del(ht, var, var_len + 1);
                                }
 
-                               zend_hash_del(ht, var, var_len + 1);
                                zval_dtor(val);
 
                                /* do not output the error message to the screen,
index fffc6d07f33d213620eaf50582f2ee98c905a3cf..67e3af59740b092641627f740870fb71f371aaa9 100644 (file)
@@ -362,7 +362,7 @@ TODO:
 
 - future: respect scope ("php > function foo() { $[tab]" should only expand to local variables...)
 */
-       char *retval;
+       char *retval = NULL;
        int textlen = strlen(text);
        TSRMLS_FETCH();