Simplify code by using CreateMemTemp. No functional change intended.

Reviewer: Eli