diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 4501c96bbf2733c32d44eda050cfab6345ab9689..e10ca3eb7c16ae6147682fe409814ba6a0ac10e5 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -487,6 +487,11 @@ virCommandMassClose(virCommandPtr cmd, * Therefore we can safely allocate memory here (and transitively call * opendir/readdir) without a deadlock. */ + if (openmax < 0) { + virReportSystemError(errno, "%s", _("sysconf(_SC_OPEN_MAX) failed")); + return -1; + } + if (!(fds = virBitmapNew(openmax))) return -1;