Fix memory leak in alias method