virNetServerClientDispatchRead checked the return value but it's not
necessary any more as it can't return NULL nowadays.

Signed-off-by: Peter Krempa <pkre...@redhat.com>
---
 src/rpc/virnetserverclient.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index c9a4eb521e..b5c764b1b0 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1257,13 +1257,10 @@ static virNetMessage 
*virNetServerClientDispatchRead(virNetServerClient *client)

         /* Possibly need to create another receive buffer */
         if (client->nrequests < client->nrequests_max) {
-            if (!(client->rx = virNetMessageNew(true))) {
-                client->wantClose = true;
-            } else {
-                client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
-                client->rx->buffer = g_new0(char, client->rx->bufferLength);
-                client->nrequests++;
-            }
+            client->rx = virNetMessageNew(true);
+            client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
+            client->rx->buffer = g_new0(char, client->rx->bufferLength);
+            client->nrequests++;
         } else if (!client->nrequests_warning) {
             client->nrequests_warning = true;
             VIR_WARN("Client hit max requests limit %zd. This may result "
-- 
2.39.1

Reply via email to