diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index d1fb564bbe..b064dab448 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -1045,8 +1045,10 @@ int virNetClientAddStream(virNetClientPtr client, void virNetClientRemoveStream(virNetClientPtr client, virNetClientStreamPtr st) { - virObjectLock(client); size_t i; + + virObjectLock(client); + for (i = 0; i < client->nstreams; i++) { if (client->streams[i] == st) break;