summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-11-23 00:47:57 +0100
committerCarl Hetherington <cth@carlh.net>2023-11-29 21:20:31 +0100
commit4c644f694b9aa91df46b772478d04ca29631b822 (patch)
tree2b309dae1f2206361ec1befa26822838c99295b1
parentcb68d75e06df4df193d977600815185648e31ff0 (diff)
Fix crash when there is no LD_LIBRARY_PATHv2.17.9
-rw-r--r--src/lib/util.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index a25914a6c..efe39c1c8 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -1125,7 +1125,10 @@ setup_grok_library_path()
{
static std::string old_path;
if (old_path.empty()) {
- old_path = getenv("LD_LIRARY_PATH");
+ auto const old = getenv("LD_LIRARY_PATH");
+ if (old) {
+ old_path = old;
+ }
}
auto const grok = Config::instance()->grok();
if (!grok || grok->binary_location.empty()) {