From ef0566a96a0532da690107c80ea2d36d4db82f2a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 11 Apr 2016 10:50:30 +0100 Subject: [PATCH] [Minor] Use g_slice_alloc --- src/lua/lua_redis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index abd25a93f..952bfb883 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -116,7 +116,7 @@ lua_redis_free_args (char **args, guint nargs) g_free (args[i]); } - g_free (args); + g_slice_free1 (sizeof (gchar *) * nargs, args); } } @@ -345,7 +345,7 @@ lua_redis_parse_args (lua_State *L, gint idx, const gchar *cmd, lua_pop (L, 1); } - args = g_malloc ((top + 1) * sizeof (gchar *)); + args = g_slice_alloc ((top + 1) * sizeof (gchar *)); lua_pushnil (L); args[0] = g_strdup (cmd); top = 1; @@ -361,7 +361,7 @@ lua_redis_parse_args (lua_State *L, gint idx, const gchar *cmd, } else { /* Use merely cmd */ - args = g_malloc (sizeof (gchar *)); + args = g_slice_alloc (sizeof (gchar *)); args[0] = g_strdup (cmd); top = 1; } -- 2.39.5