Hi Martin,
Thank you for the report. PyFerret users should wait to upgrade PyFerret until I complete a new release; there will be another update to Ferret and PyFerret later this week. I am not sure at this point if it will make any difference for Ferret user's experience.
Details:
When (attempting to) compile and run the Mac version of PyFerret I ran into a number of issues, including an issue similar to that you show. It was at this time I realized there was still a mix of C-allocated memory and Python-allocated memory (although I though Python.h had aliases so the C memory management statements would actually use Python memory management). Once I got everything moved to Python memory management everything worked fine. (I just ran your test and it was successful.) I had not seen any issue on RedHat systems, but since Mac is now a Unix-type system, it does not surprise me you are seeing this on other Linux systems.
Since you are building your own PyFerret, I have checked in updates on GitHub
If you are so inclined, you might try rebuilding from that code and seeing if you still have the problem. I have been working (through the weekend) on revising code in Ferret (and PyFerret) so: (1) hopefully more C memory management statements will not appear in the future in PyFerret, and (2) we can do a thorough check of memory management to ensure everything appears as expected. So there will be further updates, but hopefully it will be insignificant for the end-user's experience.
Best,
Karl