Fixes a memory leak in the debugger (tested in apis : mpi & bbsim)