fix irep memory leak