diff --git a/lib/exceptionhandler/exceptionhandler.cpp b/lib/exceptionhandler/exceptionhandler.cpp index 40e2a46e11a..1b3e794f528 100644 --- a/lib/exceptionhandler/exceptionhandler.cpp +++ b/lib/exceptionhandler/exceptionhandler.cpp @@ -730,6 +730,11 @@ static bool fetchProgramPath(char *const output_programPath, size_t const bufSiz * output in output_programPath. */ whichProgramStream = popen(whichProgramCommand, "r"); + if(!whichProgramStream) + { + debug(LOG_WARNING, "failed to popen which"); + return false; + } bytesRead = fread(output_programPath, 1, bufSize, whichProgramStream); pclose(whichProgramStream);