Fix: free allocated memory