Issue: https://github.com/php/php-src/issues/8136
Author: pyrsmk
### Description
I have a micro service that is watching a FTP directory every N seconds. I noticed on my VM metrics
that I had a memory leak somewhere. It didn't come from my code since the used memory was
stable, so it probably came from a PHP extension instead. After narrow down the responsible code,
and tested a couple of FTP libraries, I soon realized that it came from ftp_nlist.
Here's a snippet to reproduce the issue, while watching the used memory with watch -n 1
free -m:
```php
<?php
$ftp = ftp_connect('localhost', 2121, 1);
ftp_login($ftp, 'anonymous', 'anonymous');
while (true) {
ftp_nlist($ftp, '.');
usleep(1000);
}
```
I tried to close the connection after each call, but the leak was still the same.
### PHP Version
PHP 8.1.1
### Operating System
Alpine Linux inside Docker