dmm: free allocated memory