From c704f0cef4cf8dead8ef8c975d6208fb9455e527 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Fri, 18 Oct 2013 19:41:59 +0000 Subject: [PATCH] zippath.c: Fixed crash in debug builds. [somebody] --- src/lib/util/zippath.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/util/zippath.c b/src/lib/util/zippath.c index c8c7fdee219..5542ed36885 100644 --- a/src/lib/util/zippath.c +++ b/src/lib/util/zippath.c @@ -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);