From 4c644f694b9aa91df46b772478d04ca29631b822 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 23 Nov 2023 00:47:57 +0100 Subject: Fix crash when there is no LD_LIBRARY_PATH --- src/lib/util.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()) { -- cgit v1.2.3