overlay: Fix potential memory leak.

Also guards against the case where list allocation fails and null is returned.

Calling free on it is OK, since string_list_free would just return early if the given list is null.