diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-08-21 23:36:31 +0100 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-08-21 23:36:31 +0100 |
commit | 76e3e99dd674fe98130ba110564c607b12a7772c (patch) | |
tree | a41bcd6977d13ff2c5f7638d302dce0203667ee5 /sapi/phpdbg/phpdbg_cmd.c | |
parent | f9ae74a4c05584983add5ab68042419d44032b1b (diff) | |
download | php-git-76e3e99dd674fe98130ba110564c607b12a7772c.tar.gz |
Fix issues with phpdbg SIGINT handler
Also fix valgrind warnings in allocator when not using mmap()ed memory
Diffstat (limited to 'sapi/phpdbg/phpdbg_cmd.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_cmd.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index a50b340e7d..ed4cf3b6d6 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -768,16 +768,14 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */ if (buffer && strlen(buffer)) { if (PHPDBG_G(buffer)) { - efree(PHPDBG_G(buffer)); + free(PHPDBG_G(buffer)); } - PHPDBG_G(buffer) = estrdup(buffer); - } else { - if (PHPDBG_G(buffer)) { - if (buffer) { - efree(buffer); - } - buffer = estrdup(PHPDBG_G(buffer)); + PHPDBG_G(buffer) = strdup(buffer); + } else if (PHPDBG_G(buffer)) { + if (buffer) { + efree(buffer); } + buffer = estrdup(PHPDBG_G(buffer)); } return buffer; |