Fixed memory leak when using \define