diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-29 12:25:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-29 12:25:45 +0000 |
commit | 4beb2f2970d709169db316483a6bc547fdcaba8d (patch) | |
tree | 66c3f0e934b8eb4905e408356167bec326ebfa8e /src/rspamadm | |
parent | a47922458216ce76eb5c591096cb8d4bd41f03c3 (diff) | |
download | rspamd-4beb2f2970d709169db316483a6bc547fdcaba8d.tar.gz rspamd-4beb2f2970d709169db316483a6bc547fdcaba8d.zip |
[Minor] Final stage of g_slice removal
Diffstat (limited to 'src/rspamadm')
-rw-r--r-- | src/rspamadm/confighelp.c | 2 | ||||
-rw-r--r-- | src/rspamadm/fuzzy_merge.c | 14 | ||||
-rw-r--r-- | src/rspamadm/lua_repl.c | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/rspamadm/confighelp.c b/src/rspamadm/confighelp.c index 26251937e..a64afe4b0 100644 --- a/src/rspamadm/confighelp.c +++ b/src/rspamadm/confighelp.c @@ -235,7 +235,7 @@ rspamadm_confighelp (gint argc, gchar **argv) /* Init modules to get documentation strings */ for (pmod = cfg->compiled_modules; pmod != NULL && *pmod != NULL; pmod++) { mod = *pmod; - mod_ctx = g_slice_alloc0 (sizeof (struct module_ctx)); + mod_ctx = g_malloc0 (sizeof (struct module_ctx)); if (mod->module_init_func (cfg, &mod_ctx) == 0) { g_hash_table_insert (cfg->c_modules, diff --git a/src/rspamadm/fuzzy_merge.c b/src/rspamadm/fuzzy_merge.c index 92a434064..c286bffa9 100644 --- a/src/rspamadm/fuzzy_merge.c +++ b/src/rspamadm/fuzzy_merge.c @@ -332,7 +332,7 @@ rspamadm_fuzzy_merge (gint argc, gchar **argv) * local one then we replace dest value with the src value */ if (src_value > value && src_flag == flag) { - nop = g_slice_alloc (sizeof (*nop)); + nop = g_malloc0 (sizeof (*nop)); nop->op = OP_UPDATE; memcpy (nop->digest, digest, sizeof (nop->digest)); @@ -355,7 +355,7 @@ rspamadm_fuzzy_merge (gint argc, gchar **argv) else { ndup_other ++; } - g_slice_free1 (sizeof (*nop), nop); + g_free (nop); } } else { @@ -366,7 +366,7 @@ rspamadm_fuzzy_merge (gint argc, gchar **argv) /* Digest has not been found, but maybe we have the same in other * sources ? */ - nop = g_slice_alloc (sizeof (*nop)); + nop = g_malloc0 (sizeof (*nop)); nop->op = OP_INSERT; memcpy (nop->digest, digest, sizeof (nop->digest)); @@ -393,7 +393,7 @@ rspamadm_fuzzy_merge (gint argc, gchar **argv) else { ndup_other++; } - g_slice_free1 (sizeof (*nop), nop); + g_free (nop); } } } @@ -414,7 +414,7 @@ rspamadm_fuzzy_merge (gint argc, gchar **argv) if ((op = g_hash_table_lookup (digests_id, &id)) != NULL) { /* value, number, digest_id */ - nop = g_slice_alloc (sizeof (*nop)); + nop = g_malloc0 (sizeof (*nop)); nop->op = OP_INSERT_SHINGLE; memcpy (nop->digest, op->digest, sizeof (nop->digest)); nop->data.shgl.number = sqlite3_column_int64 (shgl_stmt, 1); @@ -547,7 +547,7 @@ rspamadm_fuzzy_merge (gint argc, gchar **argv) sqlite3_close (dest_db); for (i = 0; i < ops->len; i++) { op = g_ptr_array_index (ops, i); - g_slice_free1 (sizeof (*op), op); + g_free (op); } g_ptr_array_free (ops, TRUE); rspamd_mempool_delete (pool); @@ -572,7 +572,7 @@ err: sqlite3_close (dest_db); for (i = 0; i < ops->len; i++) { op = g_ptr_array_index (ops, i); - g_slice_free1 (sizeof (*op), op); + g_free (op); } g_ptr_array_free (ops, TRUE); rspamd_mempool_delete (pool); diff --git a/src/rspamadm/lua_repl.c b/src/rspamadm/lua_repl.c index 96b6940ae..f959c6bf3 100644 --- a/src/rspamadm/lua_repl.c +++ b/src/rspamadm/lua_repl.c @@ -548,7 +548,7 @@ rspamadm_lua_accept_cb (gint fd, short what, void *arg) return; } - session = g_slice_alloc0 (sizeof (*session)); + session = g_malloc0 (sizeof (*session)); session->rt = ctx->rt; session->ctx = ctx; session->addr = addr; @@ -571,7 +571,7 @@ rspamadm_lua_finish_handler (struct rspamd_http_connection_entry *conn_ent) { struct rspamadm_lua_repl_session *session = conn_ent->ud; - g_slice_free1 (sizeof (*session), session); + g_free (session); } /* @@ -740,7 +740,7 @@ rspamadm_lua (gint argc, gchar **argv) } ev_base = event_init (); - ctx = g_slice_alloc0 (sizeof (*ctx)); + ctx = g_malloc0 (sizeof (*ctx)); http = rspamd_http_router_new (rspamadm_lua_error_handler, rspamadm_lua_finish_handler, NULL, ev_base, @@ -758,7 +758,7 @@ rspamadm_lua (gint argc, gchar **argv) if (fd != -1) { struct event *ev; - ev = g_slice_alloc0 (sizeof (*ev)); + ev = g_malloc0 (sizeof (*ev)); event_set (ev, fd, EV_READ|EV_PERSIST, rspamadm_lua_accept_cb, ctx); event_base_set (ev_base, ev); |