You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warning: ftp_nb_fget(): Closing data Connection. in /home/niels/php-src/memleak.php on line 11
[Fri Feb 10 21:53:49 2023] Script: '/home/niels/php-src/memleak.php'
/home/niels/php-src/ext/ftp/ftp.c(1631) : Freeing 0x00007f3176889000 (4108 bytes), script=/home/niels/php-src/memleak.php
=== Total 1 memory leaks detected ===
But I expected this output instead:
Warning: ftp_nb_fget(): Closing data Connection. in /home/niels/php-src/memleak.php on line 11
Seems like the ftp->data pointer gets overwritten before the previous action is done(? not sure, I haven't looked into detail). In any case the pointer is overwritten and the old one isn't freed.
Discovered while developing PR #10525.
There's actually a couple of places where ftp->data could get overwritten I think. Maybe we shouldn't allow doing two non-blocking actions at the same time?
Activity
Fix phpGH-10562: Memory leak and invalid state with consecutive ftp_n…
Fix GH-10562: Memory leak and invalid state with consecutive ftp_nb_fget
Merge branch 'PHP-8.1' into PHP-8.2
Merge branch 'PHP-8.2'