summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2013-11-25 18:58:03 +0100
committerBob Weinand <bobwei9@hotmail.com>2013-11-25 18:58:03 +0100
commitbe8adbb231f7c7a70c8b12d032c028dd8d954e8d (patch)
tree38bba8684b6f0a11d4c7c2bd92683dcb2a8ffa0d
parent781bd90de338c2542594a859f00c893c7e1d6b89 (diff)
downloadphp-git-be8adbb231f7c7a70c8b12d032c028dd8d954e8d.tar.gz
Fix segfault in source command
-rw-r--r--phpdbg.c2
-rw-r--r--phpdbg_prompt.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/phpdbg.c b/phpdbg.c
index d790f9d0f3..ebe7cafb7b 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -652,7 +652,7 @@ phpdbg_main:
case 'i': { /* set init file */
init_file_len = strlen(php_optarg);
if (init_file_len) {
- init_file = strdup(php_optarg);
+ init_file = estrdup(php_optarg);
}
} break;
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 84b1838929..0e79e51cc6 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -149,7 +149,7 @@ next_line:
}
if (free_init) {
- free(init_file);
+ efree(init_file);
}
}
} /* }}} */
@@ -176,7 +176,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS
if (i != -1) {
scan_dir[i] = 0;
}
- init_file = malloc(strlen(scan_dir) + sizeof(PHPDBG_INIT_FILENAME));
+ init_file = emalloc(strlen(scan_dir) + sizeof(PHPDBG_INIT_FILENAME));
sprintf(init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME);
phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC);
if (i == -1) {