summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-11-23 00:47:57 +0100
committerCarl Hetherington <cth@carlh.net>2024-01-28 02:01:58 +0100
commit896d787e218381b7b0b16b7a64b51993b7dc326a (patch)
tree1aefe74f1fe05140ec0deb0c0da1ad304caa8595 /src/lib
parentec2ae7e150392725b0f1dbbccffce8f0cafe1c09 (diff)
Fix crash when there is no LD_LIBRARY_PATH
Diffstat (limited to 'src/lib')
-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 e8cbe9843..930cc353d 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -1126,7 +1126,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()) {