I have a memory leak. See attached example, which is an adapted portion of a much larger code.
This code (and the rest of the application) was doing everything with pointers. Over the past few months I have been replacing them all with allocatables, on the assumption that memory leaks are not possible with allocatables. ...Well clearly I was mistaken on that, so what am I doing wrong?
The leak occurs in copy_branch_plot_results, when it calls construct_branch_plot_results. In its original form with pointers, the code was a lot busier, with explicit tests all over to de-allocate the pointers where necessarry. I assumed this was not required with allocatables, so removed most of it, and was dismayed to find that my changes introduced leaks.