Remove leaking code with boost counterpart.
Merge pull request #1015 from ktf/fix-leak-in-l1

Remove leaking code with boost counterpart.