]> granicus.if.org Git - php/commitdiff
Don't use zmm for PHPDBG_G(exec)
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 27 Jun 2019 10:41:41 +0000 (12:41 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 27 Jun 2019 12:20:30 +0000 (14:20 +0200)
Uses system allocator when backing up settings ... let's avoid
unnecessary confusion.

sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg_prompt.c
sapi/phpdbg/phpdbg_utils.c

index 6a684718b4467b5e5ae1e214eb4349d36fc07d3c..d334870f7e63c6f4477a9e360a6d0b78dc8b569f 100644 (file)
@@ -249,7 +249,7 @@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
        }
 
        if (PHPDBG_G(exec)) {
-               efree(PHPDBG_G(exec));
+               free(PHPDBG_G(exec));
                PHPDBG_G(exec) = NULL;
        }
 
@@ -325,11 +325,11 @@ static PHP_FUNCTION(phpdbg_exec)
                        if (sb.st_mode & (S_IFREG|S_IFLNK)) {
                                if (PHPDBG_G(exec)) {
                                        ZVAL_STRINGL(return_value, PHPDBG_G(exec), PHPDBG_G(exec_len));
-                                       efree(PHPDBG_G(exec));
+                                       free(PHPDBG_G(exec));
                                        result = 0;
                                }
 
-                               PHPDBG_G(exec) = estrndup(ZSTR_VAL(exec), ZSTR_LEN(exec));
+                               PHPDBG_G(exec) = strndup(ZSTR_VAL(exec), ZSTR_LEN(exec));
                                PHPDBG_G(exec_len) = ZSTR_LEN(exec);
 
                                if (result) {
index f2f20ae75b099ca5474c9aa7be0e62b650d273ba..81962b39eefacc2928b9f659d687478aaaae047a 100644 (file)
@@ -421,7 +421,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
 
                                if (PHPDBG_G(exec)) {
                                        phpdbg_notice("exec", "type=\"unset\" context=\"%s\"", "Unsetting old execution context: %s", PHPDBG_G(exec));
-                                       efree(PHPDBG_G(exec));
+                                       free(PHPDBG_G(exec));
                                        PHPDBG_G(exec) = NULL;
                                        PHPDBG_G(exec_len) = 0L;
                                }
@@ -436,7 +436,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
 
                                VCWD_CHDIR_FILE(res);
 
-                               *SG(request_info).argv = PHPDBG_G(exec);
+                               *SG(request_info).argv = estrndup(PHPDBG_G(exec), PHPDBG_G(exec_len));
                                php_build_argv(NULL, &PG(http_globals)[TRACK_VARS_SERVER]);
 
                                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) {
        }
 
        if (PHPDBG_G(exec)) {
-               efree(PHPDBG_G(exec));
+               free(PHPDBG_G(exec));
        }
-       PHPDBG_G(exec) = estrdup("Standard input code");
+       PHPDBG_G(exec) = strdup("Standard input code");
        PHPDBG_G(exec_len) = sizeof("Standard input code") - 1;
        { /* remove leading ?> from source */
                int i;
index 38e3d383776fcc58809d47d0a34394f471691ce3..857b5e33111de07d886206d61c7e5171a3afadaa 100644 (file)
@@ -154,7 +154,7 @@ PHPDBG_API char *phpdbg_resolve_path(const char *path) /* {{{ */
                return NULL;
        }
 
-       return estrdup(resolved_name);
+       return strdup(resolved_name);
 } /* }}} */
 
 PHPDBG_API const char *phpdbg_current_file(void) /* {{{ */