Fix a memory leak in cabinet (try 2)