diff options
author | David Carlier <devnexen@gmail.com> | 2016-06-27 07:42:49 +0100 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2016-06-27 07:44:21 +0100 |
commit | 85e985f191c228cb6b119ebe223d682c9166fdc2 (patch) | |
tree | 108e0d17ee6b4929f2f1a057e3da4f62fc307781 /sapi/phpdbg/phpdbg.c | |
parent | 8de8636a2b6dc331486284f1f037259bb7347768 (diff) | |
download | php-git-85e985f191c228cb6b119ebe223d682c9166fdc2.tar.gz |
couple of resource leaks fixes and use after free's
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r-- | sapi/phpdbg/phpdbg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 0a45882251..ecd3f3974e 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1433,6 +1433,7 @@ phpdbg_main: case 'i': { /* set init file */ if (init_file) { free(init_file); + init_file = NULL; } init_file_len = strlen(php_optarg); @@ -1786,7 +1787,9 @@ phpdbg_main: /* initialize from file */ PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING; zend_try { - phpdbg_init(init_file, init_file_len, init_file_default); + if (init_file) { + phpdbg_init(init_file, init_file_len, init_file_default); + } if (bp_tmp) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; phpdbg_string_init(bp_tmp); |