diff --git a/src/config.c b/src/config.c index 13de76a0..60bc72ee 100644 --- a/src/config.c +++ b/src/config.c @@ -976,7 +976,10 @@ dobackup(const char *oldver) tvhinfo("config", "backup: migrating config from %s (running %s)", oldver, tvheadend_version); - getcwd(cwd, sizeof(cwd)); + if (getcwd(cwd, sizeof(cwd)) == NULL) { + tvherror("config", "unable to get the current working directory"); + goto fatal; + } if (!access("/bin/tar", X_OK)) argv[0] = "/bin/tar";