rpc: avoid null deref

Detected by Coverity.

* src/rpc/virnetserverclient.c (virNetServerClientDispatchRead):
Avoid null deref on OOM.
This commit is contained in:
Eric Blake 2011-08-02 15:57:19 -06:00
parent 44ebb18ec2
commit 8d0be8fd57
1 changed files with 3 additions and 2 deletions

View File

@ -786,9 +786,10 @@ readmore:
if (client->nrequests < client->nrequests_max) {
if (!(client->rx = virNetMessageNew())) {
client->wantClose = true;
} else {
client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
client->nrequests++;
}
client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
client->nrequests++;
}
virNetServerClientUpdateEvent(client);
}