Skip to content

Commit 47acfbd

Browse files
Josette Van HeusdenJosette Van Heusden
authored andcommitted
closedir on mac segfaults when given a null pointer
also enabled debug-release
1 parent b5898c4 commit 47acfbd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,5 @@ endif()
172172
include(CMakePrintSystemInformation)
173173
message("CMAKE_C_LIBRARY_ARCHITECTURE ${CMAKE_C_LIBRARY_ARCHITECTURE}")
174174

175+
176+
set(CMAKE_BUILD_TYPE RelWithDebInfo)

config.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,8 @@ void load_configfile_wrapper(char *config_file)
12641264

12651265
free(path);
12661266

1267-
closedir(dir);
1267+
if (dir)
1268+
closedir(dir);
12681269
}
12691270

12701271
if (config_file)

0 commit comments

Comments
 (0)