[librest] utils: Change alloc function to malloc



commit 997ad55e32c9566b69ea2f1ece5b84bc3dd9ba1f
Author: Günther Wagner <info gunibert de>
Date:   Mon Mar 28 20:16:05 2022 +0200

    utils: Change alloc function to malloc
    
    This fixes problems with bindings if they want to free resources

 rest/rest-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rest/rest-utils.c b/rest/rest-utils.c
index 939d49e..df283e0 100644
--- a/rest/rest-utils.c
+++ b/rest/rest-utils.c
@@ -1,6 +1,6 @@
 /* rest-utils.c
  *
- * Copyright 2021 Günther Wagner <info gunibert de>
+ * Copyright 2021-2022 Günther Wagner <info gunibert de>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU Lesser General Public License,
@@ -30,7 +30,7 @@ gchar *
 random_string (guint length)
 {
   g_autoptr(GRand) rand = g_rand_new ();
-  gchar *buffer = g_slice_alloc0 (sizeof (gchar) * length + 1);
+  gchar *buffer = g_malloc0 (sizeof (gchar) * length + 1);
   gchar alphabeth[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
 
   for (guint i = 0; i < length; i++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]