mirror of https://gitee.com/openkylin/libvirt.git
rpc: avoid null deref
Detected by Coverity. * src/rpc/virnetserverclient.c (virNetServerClientDispatchRead): Avoid null deref on OOM.
This commit is contained in:
parent
44ebb18ec2
commit
8d0be8fd57
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue