]> granicus.if.org Git - php/commitdiff
merge Tony's patch to fix memleak
authorNuno Lopes <nlopess@php.net>
Wed, 3 Jan 2007 20:04:57 +0000 (20:04 +0000)
committerNuno Lopes <nlopess@php.net>
Wed, 3 Jan 2007 20:04:57 +0000 (20:04 +0000)
ext/ftp/ftp.c

index 998db3f74f9aaf0cde819f79fac62472aef3e0fa..367eb3adf556cb93105cdcd066fc345a25e7d494 100644 (file)
@@ -1503,6 +1503,8 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
 
        /* some servers don't open a ftp-data connection if the directory is empty */
        if (ftp->resp == 226) {
+               ftp->data = data_close(ftp, data);
+               php_stream_close(tmpstream);
                return ecalloc(1, sizeof(char**));
        }