[HapProcess] Fix a memory leak.