real: fix potential memory leak.