diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 0d88b20e80bc..88a6301f1cfa 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -407,6 +407,12 @@ DoFile(const char *savedir, const char *device) info = fdopen(fdinfo, "w"); + if (info == NULL) { + syslog(LOG_ERR, "fdopen failed: %m"); + nerr++; + goto closefd; + } + if (verbose) printheader(stdout, &kdhl, device, bounds, status);