Fix memory leak when compiling return type info