diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 906fdf5c1a..cea4f84b14 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -349,6 +349,9 @@ int qemuTestCapsCacheInsert(virFileCachePtr cache, tmpCaps = virQEMUCapsNew(); } + if (!tmpCaps) + return -1; + if (!virQEMUCapsHasMachines(tmpCaps)) { const char *defaultRAMid = NULL;