summaryrefslogtreecommitdiff
path: root/zen/FindFilePlus/find_file_plus.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:21:41 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:21:41 +0200
commitd6301fca6b78db52d0d98f8e0799aba175ad2e59 (patch)
tree0380aac034e0d70ee058db07900d80ff20cfc81e /zen/FindFilePlus/find_file_plus.cpp
parent5.7 (diff)
downloadFreeFileSync-d6301fca6b78db52d0d98f8e0799aba175ad2e59.tar.gz
FreeFileSync-d6301fca6b78db52d0d98f8e0799aba175ad2e59.tar.bz2
FreeFileSync-d6301fca6b78db52d0d98f8e0799aba175ad2e59.zip
5.8
Diffstat (limited to 'zen/FindFilePlus/find_file_plus.cpp')
-rw-r--r--zen/FindFilePlus/find_file_plus.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/zen/FindFilePlus/find_file_plus.cpp b/zen/FindFilePlus/find_file_plus.cpp
index 9b146008..5fc1a538 100644
--- a/zen/FindFilePlus/find_file_plus.cpp
+++ b/zen/FindFilePlus/find_file_plus.cpp
@@ -1,7 +1,7 @@
// **************************************************************************
// * This file is part of the FreeFileSync project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
-// * Copyright (C) ZenJu (zenju AT gmx DOT de) - All Rights Reserved *
+// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// **************************************************************************
#include "find_file_plus.h"
@@ -9,8 +9,8 @@
//#include <windows.h> //these two don't play nice with each other
#include "load_dll.h"
#include <zen/scope_guard.h>
-
-#include <cstdio>
+#include <new>
+//#include <cstdio>
using namespace dll;
using namespace findplus;
@@ -357,13 +357,18 @@ FindHandle findplus::openDir(const wchar_t* dirname)
{
try
{
- return new FileSearcher(dirname); //throw NtFileError
+ return new FileSearcher(dirname); //throw NtFileError, std::bad_alloc
}
catch (const NtFileError& e)
{
setWin32Error(rtlNtStatusToDosError(e.ntError));
return nullptr;
}
+ catch (const std::bad_alloc&) //not unlikely in this context! => handle!
+ {
+ setWin32Error(rtlNtStatusToDosError(STATUS_NO_MEMORY));
+ return nullptr;
+ }
}
bgstack15