Added handling of out of memory

This commit is contained in:
Robert Osfield
2016-06-30 07:50:40 +01:00
parent 99a426d47d
commit 1e0a187613

View File

@@ -3155,6 +3155,10 @@ unzFile unzOpenInternal(LUFILE *fin)
fin->initial_offset = 0; // since the zipfile itself is expected to handle this
unz_s *s = (unz_s*)zmalloc(sizeof(unz_s));
// out of memory
if (!s) return NULL;
*s=us;
unzGoToFirstFile((unzFile)s);
return (unzFile)s;