[aot] Fix a small memory leak.