Skip to content

Commit 2149ed7

Browse files
committed
Don't use zmm for PHPDBG_G(exec)
Uses system allocator when backing up settings ... let's avoid unnecessary confusion.
1 parent 78375aa commit 2149ed7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

sapi/phpdbg/phpdbg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
249249
}
250250

251251
if (PHPDBG_G(exec)) {
252-
efree(PHPDBG_G(exec));
252+
free(PHPDBG_G(exec));
253253
PHPDBG_G(exec) = NULL;
254254
}
255255

@@ -325,11 +325,11 @@ static PHP_FUNCTION(phpdbg_exec)
325325
if (sb.st_mode & (S_IFREG|S_IFLNK)) {
326326
if (PHPDBG_G(exec)) {
327327
ZVAL_STRINGL(return_value, PHPDBG_G(exec), PHPDBG_G(exec_len));
328-
efree(PHPDBG_G(exec));
328+
free(PHPDBG_G(exec));
329329
result = 0;
330330
}
331331

332-
PHPDBG_G(exec) = estrndup(ZSTR_VAL(exec), ZSTR_LEN(exec));
332+
PHPDBG_G(exec) = strndup(ZSTR_VAL(exec), ZSTR_LEN(exec));
333333
PHPDBG_G(exec_len) = ZSTR_LEN(exec);
334334

335335
if (result) {

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
421421

422422
if (PHPDBG_G(exec)) {
423423
phpdbg_notice("exec", "type=\"unset\" context=\"%s\"", "Unsetting old execution context: %s", PHPDBG_G(exec));
424-
efree(PHPDBG_G(exec));
424+
free(PHPDBG_G(exec));
425425
PHPDBG_G(exec) = NULL;
426426
PHPDBG_G(exec_len) = 0L;
427427
}
@@ -436,7 +436,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
436436

437437
VCWD_CHDIR_FILE(res);
438438

439-
*SG(request_info).argv = PHPDBG_G(exec);
439+
*SG(request_info).argv = estrndup(PHPDBG_G(exec), PHPDBG_G(exec_len));
440440
php_build_argv(NULL, &PG(http_globals)[TRACK_VARS_SERVER]);
441441

442442
phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec));
@@ -534,9 +534,9 @@ int phpdbg_compile_stdin(zend_string *code) {
534534
}
535535

536536
if (PHPDBG_G(exec)) {
537-
efree(PHPDBG_G(exec));
537+
free(PHPDBG_G(exec));
538538
}
539-
PHPDBG_G(exec) = estrdup("Standard input code");
539+
PHPDBG_G(exec) = strdup("Standard input code");
540540
PHPDBG_G(exec_len) = sizeof("Standard input code") - 1;
541541
{ /* remove leading ?> from source */
542542
int i;

sapi/phpdbg/phpdbg_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ PHPDBG_API char *phpdbg_resolve_path(const char *path) /* {{{ */
154154
return NULL;
155155
}
156156

157-
return estrdup(resolved_name);
157+
return strdup(resolved_name);
158158
} /* }}} */
159159

160160
PHPDBG_API const char *phpdbg_current_file(void) /* {{{ */

0 commit comments

Comments
 (0)