diff --git a/NEWS b/NEWS index 93e6fda1369..18da8f7e033 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP 4 NEWS ? ? ??? 200?, Version 5.0.0 - Moved extensions to PECL (http://pear.php.net/): (James, Tal) . ext/fribidi +- Fixed bug #22059 (ftp_chdir causes segfault). (Sara) - Fixed bug #20442 (upgraded bundled expat to 1.95.5). (Ilia) - Fixed bug #20155 (xmlrpc compile problem with ZE2). (Derick, Jan Schneider) - Changed get_extension_funcs() to return list of the built-in Zend Engine diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 8cafa790e01..b980d697089 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -473,7 +473,8 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir) return 0; } - efree(ftp->pwd); + if (ftp->pwd) + efree(ftp->pwd); if (!ftp_putcmd(ftp, "CWD", dir)) { return 0; @@ -494,7 +495,8 @@ ftp_cdup(ftpbuf_t *ftp) return 0; } - efree(ftp->pwd); + if (ftp->pwd) + efree(ftp->pwd); if (!ftp_putcmd(ftp, "CDUP", NULL)) { return 0;