diff options
author | Günther Wagner <info@gunibert.de> | 2022-03-28 20:16:05 +0200 |
---|---|---|
committer | Günther Wagner <info@gunibert.de> | 2022-03-28 20:18:14 +0200 |
commit | 997ad55e32c9566b69ea2f1ece5b84bc3dd9ba1f (patch) | |
tree | 5f49eb8f069562845a62416ec5abf57158318f20 | |
parent | b8d84827159c17e77856ca1c944a3f2599a6fe9c (diff) | |
download | librest-997ad55e32c9566b69ea2f1ece5b84bc3dd9ba1f.tar.gz |
utils: Change alloc function to malloc
This fixes problems with bindings if they want to free resources
-rw-r--r-- | rest/rest-utils.c | 4 |
1 files 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++) |