summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-16 17:09:32 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-16 17:09:32 +0300
commitccc12b82da5dd10b44ab067b68b762298a9eb4eb (patch)
tree9b17d9d3f99f518fe44532c55ac255c3e0134a13 /ext/session
parentce18738a30b3d7f20b392c9167aa251c009a0c21 (diff)
downloadphp-git-ccc12b82da5dd10b44ab067b68b762298a9eb4eb.tar.gz
Avoid unnecessary reference-counting on strings.
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/session/session.c b/ext/session/session.c
index bfd1c9b566..3fa1b7a026 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2383,11 +2383,12 @@ static PHP_FUNCTION(session_start)
if (zend_string_equals_literal(str_idx, "read_and_close")) {
read_and_close = zval_get_long(value);
} else {
- zend_string *val = zval_get_string(value);
+ zend_string *tmp_val;
+ zend_string *val = zval_get_tmp_string(value, &tmp_val);
if (php_session_start_set_ini(str_idx, val) == FAILURE) {
php_error_docref(NULL, E_WARNING, "Setting option '%s' failed", ZSTR_VAL(str_idx));
}
- zend_string_release(val);
+ zend_tmp_string_release(tmp_val);
}
break;
default: