lua: fix memory leak in changes method