[Spice-devel] [PATCH] reds: do not use g_malloc0 in server code

Frediano Ziglio fziglio at redhat.com
Thu Dec 10 11:55:01 PST 2015


The rest of code is using spice_malloc* functions, use them for
consistency.

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

diff --git a/server/reds.c b/server/reds.c
index 75a7d95..568741c 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1888,7 +1888,7 @@ static void reds_handle_ticket(void *opaque)
                       RSA_size(link->tiTicketing.rsa), SPICE_MAX_PASSWORD_LENGTH);
     }
 
-    password = g_malloc0(RSA_size(link->tiTicketing.rsa) + 1);
+    password = spice_malloc0(RSA_size(link->tiTicketing.rsa) + 1);
     password_size = RSA_private_decrypt(link->tiTicketing.rsa_size,
                                         link->tiTicketing.encrypted_ticket.encrypted_data,
                                         (unsigned char *)password,
@@ -1928,7 +1928,7 @@ error:
     reds_link_free(link);
 
 end:
-    g_free(password);
+    free(password);
 }
 
 static void reds_get_spice_ticket(RedLinkInfo *link)
-- 
2.4.3



More information about the Spice-devel mailing list