From 289ad3960e3851872cb509fab42d9121d13ae7d1 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 15 May 2003 13:33:18 +0000 Subject: [PATCH] Fix the way we create references to (sometimes non-)existing variables. Credits go to Rob Richards and Zeev --- ext/session/session.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/session/session.c b/ext/session/session.c index 04fa63a916..7bc6725f1e 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -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 { -- 2.40.0