]> granicus.if.org Git - php/commitdiff
Fix the way we create references to (sometimes non-)existing
authorSascha Schumann <sas@php.net>
Thu, 15 May 2003 13:33:18 +0000 (13:33 +0000)
committerSascha Schumann <sas@php.net>
Thu, 15 May 2003 13:33:18 +0000 (13:33 +0000)
variables.

Credits go to Rob Richards <rrichards@digarc.com> and Zeev

ext/session/session.c

index 04fa63a916f7b1d98e279f44a17fb4548ce5bd39..7bc6725f1ec633c84f3279f10b3a1833a4dbbdd0 100644 (file)
@@ -281,8 +281,10 @@ void php_add_session_var(char *name, size_t namelen TSRMLS_DC)
                        /* The next call will increase refcount by NR_OF_SYM_TABLES==2 */
                        zend_set_hash_symbol(empty_var, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
                } else if (sym_global == NULL) {
+                       SEPARATE_ZVAL_IF_NOT_REF(sym_track);
                        zend_set_hash_symbol(*sym_track, name, namelen, 1, 1, &EG(symbol_table));
                } else if (sym_track == NULL) {
+                       SEPARATE_ZVAL_IF_NOT_REF(sym_global);
                        zend_set_hash_symbol(*sym_global, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars)));
                }
        } else {