Fix memory leak in snapshot open

Change-Id: I28c6ea04398807eebd71c7dbf17f4ac178d50170