summarylogtreecommitdiffstats
path: root/epsonscan2-crash.patch
blob: 67fd8e46d26a36b531cc225e54a8ce13403fafae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
commit 1b36a6453e8af4bb7d7d470fa22c83200055b57e
Author: Hubert Figuière <hub@figuiere.net>
Date:   Wed Oct 19 14:16:50 2022 -0400

    Fix crash on device detection

diff --git a/src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp b/src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp
index 0390a71..d98cd21 100644
--- a/src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp
+++ b/src/ES2Command/Src/Interface/ipc/ipcInterfaceImpl.cpp
@@ -131,7 +131,9 @@ ESErrorCode IPCInterfaceImpl::Open()
         if(!ES_IsExistFile(dat_file)){
             FILE *fp;
             fp = fopen(dat_file.c_str(),"w");
-            fclose(fp);
+            if (fp) {
+              fclose(fp);
+            }
         }
 
         interrupt_.reset(new ipc_interrupt(delegate_, dat_file, IPC_SHARED_ID, IPC_SEMAHORE_KEY));