mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
zippath.c: Fixed crash in debug builds. [somebody]
This commit is contained in:
parent
4a5fbe75e6
commit
c704f0cef4
@ -614,13 +614,16 @@ file_error zippath_opendir(const char *path, zippath_directory **directory)
|
||||
file_error err;
|
||||
|
||||
/* allocate a directory */
|
||||
zippath_directory *result = new(std::nothrow) zippath_directory;
|
||||
if (result == NULL)
|
||||
zippath_directory *result = NULL;
|
||||
try
|
||||
{
|
||||
result = new zippath_directory;
|
||||
}
|
||||
catch (std::bad_alloc &)
|
||||
{
|
||||
err = FILERR_OUT_OF_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* resolve the path */
|
||||
osd_dir_entry_type entry_type;
|
||||
err = zippath_resolve(path, entry_type, result->zipfile, result->zipprefix);
|
||||
|
Loading…
Reference in New Issue
Block a user