Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string.

This commit is contained in:
Dmitry Stogov 2018-05-08 17:30:15 +03:00
parent 9565075cbd
commit 524f5245c5
36 changed files with 176 additions and 168 deletions

View file

@ -600,7 +600,7 @@ PHPAPI void php_build_argv(char *s, zval *track_vars_array)
for (i = 0; i < SG(request_info).argc; i++) {
ZVAL_STRING(&tmp, SG(request_info).argv[i]);
if (zend_hash_next_index_insert(Z_ARRVAL(arr), &tmp) == NULL) {
zend_string_free(Z_STR(tmp));
zend_string_efree(Z_STR(tmp));
}
}
} else if (s && *s) {
@ -614,7 +614,7 @@ PHPAPI void php_build_argv(char *s, zval *track_vars_array)
ZVAL_STRING(&tmp, ss);
count++;
if (zend_hash_next_index_insert(Z_ARRVAL(arr), &tmp) == NULL) {
zend_string_free(Z_STR(tmp));
zend_string_efree(Z_STR(tmp));
}
if (space) {
*space = '+';