]> granicus.if.org Git - php/commitdiff
Fix prompt leak in phpdbg
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 21 Jun 2019 13:56:02 +0000 (15:56 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 21 Jun 2019 15:01:18 +0000 (17:01 +0200)
sapi/phpdbg/phpdbg.c

index 2d9639de464ab8204869026bdb61274c5b2943cd..6a684718b4467b5e5ae1e214eb4349d36fc07d3c 100644 (file)
@@ -1661,9 +1661,6 @@ phpdbg_main:
        phpdbg_set_color_ex(PHPDBG_COLOR_ERROR,   PHPDBG_STRL("red-bold"));
        phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE,  PHPDBG_STRL("green"));
 
-       /* set default prompt */
-       phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT);
-
        if (settings > (zend_phpdbg_globals *) 0x2) {
 #ifdef ZTS
                zend_phpdbg_globals *ptr = TSRMG_BULK_STATIC(phpdbg_globals_id, zend_phpdbg_globals *);
@@ -1672,6 +1669,9 @@ phpdbg_main:
                phpdbg_globals = *settings;
 #endif
                free(settings);
+       } else {
+               /* set default prompt */
+               phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT);
        }
 
        /* set flags from command line */