memory leak in forward()

memory leak in forward()