[SRP] bug fix: free memory in debug version