[Spice-devel] [PATCH spice-server v2 10/23] dispatcher: Use GLib memory functions

Frediano Ziglio fziglio at redhat.com
Wed Sep 20 07:51:03 UTC 2017


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/dispatcher.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/dispatcher.c b/server/dispatcher.c
index 7fb706f8b..7e991403c 100644
--- a/server/dispatcher.c
+++ b/server/dispatcher.c
@@ -112,7 +112,7 @@ dispatcher_finalize(GObject *object)
     close(self->priv->send_fd);
     close(self->priv->recv_fd);
     pthread_mutex_destroy(&self->priv->lock);
-    free(self->priv->payload);
+    g_free(self->priv->payload);
     G_OBJECT_CLASS(dispatcher_parent_class)->finalize(object);
 }
 
@@ -352,7 +352,7 @@ void dispatcher_register_handler(Dispatcher *dispatcher, uint32_t message_type,
     msg->size = size;
     msg->ack = ack;
     if (msg->size > dispatcher->priv->payload_size) {
-        dispatcher->priv->payload = realloc(dispatcher->priv->payload, msg->size);
+        dispatcher->priv->payload = g_realloc(dispatcher->priv->payload, msg->size);
         dispatcher->priv->payload_size = msg->size;
     }
 }
-- 
2.13.5



More information about the Spice-devel mailing list