overlay: Fix potential memory leak.
Merge pull request #1205 from lioncash/overlay

overlay: Fix potential memory leak.