From: Vsevolod Stakhov Date: Mon, 11 Apr 2016 09:50:30 +0000 (+0100) Subject: [Minor] Use g_slice_alloc X-Git-Tag: 1.2.3~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ef0566a96a0532da690107c80ea2d36d4db82f2a;p=rspamd.git [Minor] Use g_slice_alloc --- 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; }