Just removing the fork() is not a solution: it will cause nano to hang when trying to filter a large file. The fork() is needed so that feeding text to the external program and reading its output can happen in parallel, so that things do not get stuck because of limited sizes of IO buffers.

The problem is that the child is not waited for, so it becomes a zombie that somehow hugs some file descriptor.