diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 52dab5dd42..9ec4d806e1 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1369,8 +1369,11 @@ testConnectAuthenticate(virConnectPtr conn, ssize_t i; char *username = NULL, *password = NULL; - if (privconn->numAuths == 0) + testDriverLock(privconn); + if (privconn->numAuths == 0) { + testDriverUnlock(privconn); return 0; + } /* Authentication is required because the test XML contains a * non-empty section. First we must ask for a username. @@ -1410,6 +1413,7 @@ testConnectAuthenticate(virConnectPtr conn, ret = 0; cleanup: + testDriverUnlock(privconn); VIR_FREE(username); VIR_FREE(password); return ret;