From fae3a611be53dbf58cbb7c2c4846081ecb87606e Mon Sep 17 00:00:00 2001 From: "Heiko Schlittermann (HS12-RIPE)" Date: Wed, 9 Mar 2016 11:51:31 +0100 Subject: [PATCH] Test the return of getcwd() --- src/src/exim.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/src/exim.c b/src/src/exim.c index 574e7804b..3b6a9ba69 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -3748,7 +3748,11 @@ directory to "/"! Later we change to $spool_directory. We do it there, because during readconf_main() some expansion takes place already. */ /* Store the initial cwd before we change directories */ -initial_cwd = getcwd(NULL, 0); +if ((initial_cwd = getcwd(NULL, 0)) == NULL) + { + perror("exim: can't get the current working directory"); + exit(EXIT_FAILURE); + } readconf_main(); -- 2.25.1