From 59fd6feb8747c0b1560dd6b99269c27ea15ce26f Mon Sep 17 00:00:00 2001 From: Andreas Rogge Date: Mon, 31 Jan 2022 13:54:53 +0100 Subject: [PATCH] lib: only unlink() when we have a pidfile --- core/src/lib/bsys.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/lib/bsys.cc b/core/src/lib/bsys.cc index cb1b8454b42..ae8eec1fd54 100644 --- a/core/src/lib/bsys.cc +++ b/core/src/lib/bsys.cc @@ -3,7 +3,7 @@ Copyright (C) 2000-2012 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2021 Bareos GmbH & Co. KG + Copyright (C) 2013-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -556,7 +556,7 @@ void WritePidFile(int pidfile_fd, int DeletePidFile(const char* pidfile_path) { #if !defined(HAVE_WIN32) - unlink(pidfile_path); + if (pidfile_path) { unlink(pidfile_path); } #endif return 1; }