diff options
-rw-r--r-- | src/libcryptobox/keypairs_cache.c | 8 | ||||
-rw-r--r-- | src/libserver/cfg_rcl.c | 28 | ||||
-rw-r--r-- | src/libserver/cfg_utils.c | 16 | ||||
-rw-r--r-- | src/libserver/dkim.c | 12 | ||||
-rw-r--r-- | src/libserver/dns.c | 12 | ||||
-rw-r--r-- | src/libserver/dynamic_cfg.c | 6 | ||||
-rw-r--r-- | src/libserver/fuzzy_backend.c | 6 | ||||
-rw-r--r-- | src/libserver/fuzzy_backend_redis.c | 17 | ||||
-rw-r--r-- | src/libserver/fuzzy_backend_sqlite.c | 4 | ||||
-rw-r--r-- | src/libserver/monitored.c | 12 | ||||
-rw-r--r-- | src/libserver/protocol.c | 6 | ||||
-rw-r--r-- | src/libserver/redis_pool.c | 12 | ||||
-rw-r--r-- | src/libserver/rspamd_control.c | 22 |
13 files changed, 81 insertions, 80 deletions
diff --git a/src/libcryptobox/keypairs_cache.c b/src/libcryptobox/keypairs_cache.c index 887aaa85d..176340712 100644 --- a/src/libcryptobox/keypairs_cache.c +++ b/src/libcryptobox/keypairs_cache.c @@ -34,7 +34,7 @@ rspamd_keypair_destroy (gpointer ptr) struct rspamd_keypair_elt *elt = (struct rspamd_keypair_elt *)ptr; REF_RELEASE (elt->nm); - g_slice_free1 (sizeof (*elt), elt); + g_free (elt); } static guint @@ -62,7 +62,7 @@ rspamd_keypair_cache_new (guint max_items) g_assert (max_items > 0); - c = g_slice_alloc (sizeof (*c)); + c = g_malloc0 (sizeof (*c)); c->hash = rspamd_lru_hash_new_full (max_items, NULL, rspamd_keypair_destroy, rspamd_keypair_hash, rspamd_keypair_equal); @@ -94,7 +94,7 @@ rspamd_keypair_cache_process (struct rspamd_keypair_cache *c, } if (new == NULL) { - new = g_slice_alloc0 (sizeof (*new)); + new = g_malloc0 (sizeof (*new)); if (posix_memalign ((void **)&new->nm, 32, sizeof (*new->nm)) != 0) { abort (); @@ -137,6 +137,6 @@ rspamd_keypair_cache_destroy (struct rspamd_keypair_cache *c) { if (c != NULL) { rspamd_lru_hash_destroy (c->hash); - g_slice_free1 (sizeof (*c), c); + g_free (c); } } diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index d0b50a74f..5f9d56a20 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -1643,7 +1643,7 @@ rspamd_rcl_add_section (struct rspamd_rcl_section **top, struct rspamd_rcl_section *new; ucl_object_t *parent_doc; - new = g_slice_alloc0 (sizeof (struct rspamd_rcl_section)); + new = g_malloc0 (sizeof (struct rspamd_rcl_section)); new->name = name; new->key_attr = key_attr; new->handler = handler; @@ -1677,16 +1677,16 @@ rspamd_rcl_add_section_doc (struct rspamd_rcl_section **top, ucl_object_t *doc_target, const gchar *doc_string) { - struct rspamd_rcl_section *new; + struct rspamd_rcl_section *new_section; - new = g_slice_alloc0 (sizeof (struct rspamd_rcl_section)); - new->name = name; - new->key_attr = key_attr; - new->handler = handler; - new->type = type; - new->strict_type = strict_type; + new_section = g_malloc0 (sizeof (struct rspamd_rcl_section)); + new_section->name = name; + new_section->key_attr = key_attr; + new_section->handler = handler; + new_section->type = type; + new_section->strict_type = strict_type; - new->doc_ref = ucl_object_ref (rspamd_rcl_add_doc_obj (doc_target, + new_section->doc_ref = ucl_object_ref (rspamd_rcl_add_doc_obj (doc_target, doc_string, name, type, @@ -1695,8 +1695,8 @@ rspamd_rcl_add_section_doc (struct rspamd_rcl_section **top, NULL, 0)); - HASH_ADD_KEYPTR (hh, *top, new->name, strlen (new->name), new); - return new; + HASH_ADD_KEYPTR (hh, *top, new_section->name, strlen (new_section->name), new_section); + return new_section; } struct rspamd_rcl_default_handler_data * @@ -1709,7 +1709,7 @@ rspamd_rcl_add_default_handler (struct rspamd_rcl_section *section, { struct rspamd_rcl_default_handler_data *nhandler; - nhandler = g_slice_alloc0 (sizeof (struct rspamd_rcl_default_handler_data)); + nhandler = g_malloc0 (sizeof (struct rspamd_rcl_default_handler_data)); nhandler->key = g_strdup (name); nhandler->handler = handler; nhandler->pd.offset = offset; @@ -3549,11 +3549,11 @@ rspamd_rcl_section_free (gpointer p) HASH_ITER (hh, cur->default_parser, dh, dhtmp) { HASH_DEL (cur->default_parser, dh); g_free (dh->key); - g_slice_free1 (sizeof (*dh), dh); + g_free (dh); } ucl_object_unref (cur->doc_ref); - g_slice_free1 (sizeof (*cur), cur); + g_free (cur); } } diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 8b8d5f4b9..079ed71c6 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -109,7 +109,7 @@ rspamd_config_new (void) { struct rspamd_config *cfg; - cfg = g_slice_alloc0 (sizeof (*cfg)); + cfg = g_malloc0 (sizeof (*cfg)); cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), "cfg"); cfg->dns_timeout = 1000; cfg->dns_retransmits = 5; @@ -202,12 +202,12 @@ rspamd_config_free (struct rspamd_config *cfg) DL_FOREACH_SAFE (cfg->finish_callbacks, sc, sctmp) { luaL_unref (cfg->lua_state, LUA_REGISTRYINDEX, sc->cbref); - g_slice_free1 (sizeof (*sc), sc); + g_free (sc); } DL_FOREACH_SAFE (cfg->on_load, sc, sctmp) { luaL_unref (cfg->lua_state, LUA_REGISTRYINDEX, sc->cbref); - g_slice_free1 (sizeof (*sc), sc); + g_free (sc); } if (cfg->monitored_ctx) { @@ -253,10 +253,10 @@ rspamd_config_free (struct rspamd_config *cfg) DL_FOREACH_SAFE (cfg->log_pipes, lp, ltmp) { close (lp->fd); - g_slice_free1 (sizeof (*lp), lp); + g_free (lp); } - g_slice_free1 (sizeof (*cfg), cfg); + g_free (cfg); } const ucl_object_t * @@ -1003,7 +1003,7 @@ rspamd_worker_conf_dtor (struct rspamd_worker_conf *wcf) ucl_object_unref (wcf->options); g_queue_free (wcf->active_workers); g_hash_table_unref (wcf->params); - g_slice_free1 (sizeof (*wcf), wcf); + g_free (wcf); } } @@ -1020,7 +1020,7 @@ rspamd_config_new_worker (struct rspamd_config *cfg, struct rspamd_worker_conf *c) { if (c == NULL) { - c = g_slice_alloc0 (sizeof (struct rspamd_worker_conf)); + c = g_malloc0 (sizeof (struct rspamd_worker_conf)); c->params = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); c->active_workers = g_queue_new (); #ifdef HAVE_SC_NPROCESSORS_ONLN @@ -1387,7 +1387,7 @@ rspamd_init_filters (struct rspamd_config *cfg, bool reconfig, GHashTable *vars) mod = *pmod; if (rspamd_check_module (cfg, mod)) { - 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/libserver/dkim.c b/src/libserver/dkim.c index 12bc146ab..0f296eaab 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1184,9 +1184,9 @@ rspamd_dkim_make_key (rspamd_dkim_context_t *ctx, const gchar *keydata, return NULL; } - key = g_slice_alloc0 (sizeof (rspamd_dkim_key_t)); + key = g_malloc0 (sizeof (rspamd_dkim_key_t)); REF_INIT_RETAIN (key, rspamd_dkim_key_free); - key->keydata = g_slice_alloc0 (keylen + 1); + key->keydata = g_malloc0 (keylen + 1); key->decoded_len = keylen; key->keylen = keylen; key->type = type; @@ -1273,8 +1273,8 @@ rspamd_dkim_key_free (rspamd_dkim_key_t *key) BIO_free (key->key_bio); } - g_slice_free1 (key->keylen, key->keydata); - g_slice_free1 (sizeof (rspamd_dkim_key_t), key); + g_free (key->keydata); + g_free (key); } void @@ -1300,7 +1300,7 @@ rspamd_dkim_sign_key_free (rspamd_dkim_sign_key_t *key) } } - g_slice_free1 (sizeof (rspamd_dkim_sign_key_t), key); + g_free (key); } static rspamd_dkim_key_t * @@ -2511,7 +2511,7 @@ rspamd_dkim_sign_key_load (const gchar *what, gsize len, } } - nkey = g_slice_alloc0 (sizeof (*nkey)); + nkey = g_malloc0 (sizeof (*nkey)); nkey->type = type; nkey->mtime = mtime; diff --git a/src/libserver/dns.c b/src/libserver/dns.c index d2629fd21..9a97d8ee3 100644 --- a/src/libserver/dns.c +++ b/src/libserver/dns.c @@ -57,7 +57,7 @@ rspamd_dns_fin_cb (gpointer arg) rdns_request_release (reqdata->req); if (reqdata->pool == NULL) { - g_slice_free1 (sizeof (struct rspamd_dns_request_ud), reqdata); + g_free (reqdata); } } @@ -77,7 +77,7 @@ rspamd_dns_callback (struct rdns_reply *reply, gpointer ud) rspamd_session_remove_event (reqdata->session, rspamd_dns_fin_cb, reqdata); } else if (reqdata->pool == NULL) { - g_slice_free1 (sizeof (struct rspamd_dns_request_ud), reqdata); + g_free (reqdata); } } @@ -104,7 +104,7 @@ make_dns_request (struct rspamd_dns_resolver *resolver, rspamd_mempool_alloc (pool, sizeof (struct rspamd_dns_request_ud)); } else { - reqdata = g_slice_alloc (sizeof (struct rspamd_dns_request_ud)); + reqdata = g_malloc (sizeof (struct rspamd_dns_request_ud)); } reqdata->pool = pool; reqdata->session = session; @@ -127,7 +127,7 @@ make_dns_request (struct rspamd_dns_resolver *resolver, if (req == NULL) { if (pool == NULL) { - g_slice_free1 (sizeof (struct rspamd_dns_request_ud), reqdata); + g_free (reqdata); } return FALSE; } @@ -218,7 +218,7 @@ rspamd_dns_server_init (struct upstream *up, guint idx, gpointer ud) g_assert (serv != NULL); - elt = g_slice_alloc0 (sizeof (*elt)); + elt = g_malloc0 (sizeof (*elt)); elt->server = serv; elt->lib_data = up; @@ -252,7 +252,7 @@ dns_resolver_init (rspamd_logger_t *logger, { struct rspamd_dns_resolver *dns_resolver; - dns_resolver = g_slice_alloc0 (sizeof (struct rspamd_dns_resolver)); + dns_resolver = g_malloc0 (sizeof (struct rspamd_dns_resolver)); dns_resolver->ev_base = ev_base; if (cfg != NULL) { dns_resolver->request_timeout = cfg->dns_timeout; diff --git a/src/libserver/dynamic_cfg.c b/src/libserver/dynamic_cfg.c index fa2cc6d1e..d576e055a 100644 --- a/src/libserver/dynamic_cfg.c +++ b/src/libserver/dynamic_cfg.c @@ -147,7 +147,7 @@ json_config_read_cb (gchar * chunk, g_assert (pd != NULL); if (data->cur_data == NULL) { - jb = g_slice_alloc (sizeof (*jb)); + jb = g_malloc0 (sizeof (*jb)); jb->cfg = pd->cfg; jb->buf = pd->buf; data->cur_data = jb; @@ -176,7 +176,7 @@ json_config_fin_cb (struct map_cb_data *data) if (data->prev_data) { jb = data->prev_data; /* Clean prev data */ - g_slice_free1 (sizeof (*jb), jb); + g_free (jb); } /* Now parse json */ @@ -230,7 +230,7 @@ init_dynamic_config (struct rspamd_config *cfg) } /* Now try to add map with json data */ - jb = g_slice_alloc (sizeof (struct config_json_buf)); + jb = g_malloc (sizeof (struct config_json_buf)); pjb = g_malloc (sizeof (struct config_json_buf *)); jb->buf = NULL; jb->cfg = cfg; diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c index 2b32d4705..b2bf90d99 100644 --- a/src/libserver/fuzzy_backend.c +++ b/src/libserver/fuzzy_backend.c @@ -295,14 +295,14 @@ rspamd_fuzzy_backend_create (struct event_base *ev_base, } } - bk = g_slice_alloc0 (sizeof (*bk)); + bk = g_malloc0 (sizeof (*bk)); bk->ev_base = ev_base; bk->expire = expire; bk->type = type; bk->subr = &fuzzy_subrs[type]; if ((bk->subr_ud = bk->subr->init (bk, config, cfg, err)) == NULL) { - g_slice_free1 (sizeof (*bk), bk); + g_free (bk); return NULL; } @@ -445,7 +445,7 @@ rspamd_fuzzy_backend_close (struct rspamd_fuzzy_backend *bk) bk->subr->close (bk, bk->subr_ud); - g_slice_free1 (sizeof (*bk), bk); + g_free (bk); } struct event_base* diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c index 7e5df5ff8..a660a8523 100644 --- a/src/libserver/fuzzy_backend_redis.c +++ b/src/libserver/fuzzy_backend_redis.c @@ -123,7 +123,7 @@ rspamd_fuzzy_redis_session_dtor (struct rspamd_fuzzy_redis_session *session, rspamd_fuzzy_redis_session_free_args (session); REF_RELEASE (session->backend); - g_slice_free1 (sizeof (*session), session); + g_free (session); } static gboolean @@ -223,7 +223,7 @@ rspamd_fuzzy_backend_redis_dtor (struct rspamd_fuzzy_backend_redis *backend) g_free (backend->id); } - g_slice_free1 (sizeof (*backend), backend); + g_free (backend); } void* @@ -236,7 +236,7 @@ rspamd_fuzzy_backend_init_redis (struct rspamd_fuzzy_backend *bk, guchar id_hash[rspamd_cryptobox_HASHBYTES]; rspamd_cryptobox_hash_state_t st; - backend = g_slice_alloc0 (sizeof (*backend)); + backend = g_malloc0 (sizeof (*backend)); backend->timeout = REDIS_DEFAULT_TIMEOUT; backend->redis_object = REDIS_DEFAULT_OBJECT; @@ -265,7 +265,8 @@ rspamd_fuzzy_backend_init_redis (struct rspamd_fuzzy_backend *bk, if (!ret) { msg_err_config ("cannot init redis backend for fuzzy storage"); - g_slice_free1 (sizeof (*backend), backend); + g_free (backend); + return NULL; } @@ -606,7 +607,7 @@ rspamd_fuzzy_backend_check_redis (struct rspamd_fuzzy_backend *bk, g_assert (backend != NULL); - session = g_slice_alloc0 (sizeof (*session)); + session = g_malloc0 (sizeof (*session)); session->backend = backend; REF_RETAIN (session->backend); @@ -737,7 +738,7 @@ rspamd_fuzzy_backend_count_redis (struct rspamd_fuzzy_backend *bk, g_assert (backend != NULL); - session = g_slice_alloc0 (sizeof (*session)); + session = g_malloc0 (sizeof (*session)); session->backend = backend; REF_RETAIN (session->backend); @@ -859,7 +860,7 @@ rspamd_fuzzy_backend_version_redis (struct rspamd_fuzzy_backend *bk, g_assert (backend != NULL); - session = g_slice_alloc0 (sizeof (*session)); + session = g_malloc0 (sizeof (*session)); session->backend = backend; REF_RETAIN (session->backend); @@ -1240,7 +1241,7 @@ rspamd_fuzzy_backend_update_redis (struct rspamd_fuzzy_backend *bk, g_assert (backend != NULL); - session = g_slice_alloc0 (sizeof (*session)); + session = g_malloc0 (sizeof (*session)); session->backend = backend; REF_RETAIN (session->backend); diff --git a/src/libserver/fuzzy_backend_sqlite.c b/src/libserver/fuzzy_backend_sqlite.c index 178f8d2be..84c6921fb 100644 --- a/src/libserver/fuzzy_backend_sqlite.c +++ b/src/libserver/fuzzy_backend_sqlite.c @@ -426,7 +426,7 @@ rspamd_fuzzy_backend_sqlite_open_db (const gchar *path, GError **err) g_assert (path != NULL); - bk = g_slice_alloc (sizeof (*bk)); + bk = g_malloc0 (sizeof (*bk)); bk->path = g_strdup (path); bk->expired = 0; bk->pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), "fuzzy_backend"); @@ -1000,7 +1000,7 @@ rspamd_fuzzy_backend_sqlite_close (struct rspamd_fuzzy_backend_sqlite *backend) rspamd_mempool_delete (backend->pool); } - g_slice_free1 (sizeof (*backend), backend); + g_free (backend); } } diff --git a/src/libserver/monitored.c b/src/libserver/monitored.c index cc11183b2..96e161e1a 100644 --- a/src/libserver/monitored.c +++ b/src/libserver/monitored.c @@ -385,7 +385,7 @@ rspamd_monitored_ctx_init (void) { struct rspamd_monitored_ctx *ctx; - ctx = g_slice_alloc0 (sizeof (*ctx)); + ctx = g_malloc0 (sizeof (*ctx)); ctx->monitoring_interval = default_monitoring_interval; ctx->max_errors = default_max_errors; ctx->elts = g_ptr_array_new (); @@ -450,7 +450,7 @@ rspamd_monitored_create_ (struct rspamd_monitored_ctx *ctx, g_assert (ctx != NULL); g_assert (line != NULL); - m = g_slice_alloc0 (sizeof (*m)); + m = g_malloc0 (sizeof (*m)); m->type = type; m->flags = flags; m->url = g_strdup (line); @@ -466,7 +466,7 @@ rspamd_monitored_create_ (struct rspamd_monitored_ctx *ctx, m->proc.monitored_dtor = rspamd_monitored_dns_dtor; } else { - g_slice_free1 (sizeof (*m), m); + g_free (m); return NULL; } @@ -474,7 +474,7 @@ rspamd_monitored_create_ (struct rspamd_monitored_ctx *ctx, m->proc.ud = m->proc.monitored_config (m, ctx, opts); if (m->proc.ud == NULL) { - g_slice_free1 (sizeof (*m), m); + g_free (m); return NULL; } @@ -603,11 +603,11 @@ rspamd_monitored_ctx_destroy (struct rspamd_monitored_ctx *ctx) rspamd_monitored_stop (m); g_free (m->url); m->proc.monitored_dtor (m, m->ctx, m->proc.ud); - g_slice_free1 (sizeof (*m), m); + g_free (m); } g_ptr_array_free (ctx->elts, TRUE); - g_slice_free1 (sizeof (*ctx), ctx); + g_free (ctx); } struct rspamd_monitored * diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index d8973dea6..25fb56a0f 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -1565,7 +1565,7 @@ rspamd_protocol_write_log_pipe (struct rspamd_task *task) sz = sizeof (*ls) + sizeof (struct rspamd_protocol_log_symbol_result) * (n + nextra); - ls = g_slice_alloc (sz); + ls = g_malloc0 (sz); /* Handle settings id */ sid = rspamd_mempool_get_variable (task->task_pool, @@ -1608,7 +1608,7 @@ rspamd_protocol_write_log_pipe (struct rspamd_task *task) } else { sz = sizeof (*ls); - ls = g_slice_alloc0 (sz); + ls = g_malloc0 (sz); ls->nresults = 0; } @@ -1618,7 +1618,7 @@ rspamd_protocol_write_log_pipe (struct rspamd_task *task) strerror (errno)); } - g_slice_free1 (sz, ls); + g_free (ls); break; default: msg_err_task ("unknown log format %d", lp->type); diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c index c9de661d1..bbc734173 100644 --- a/src/libserver/redis_pool.c +++ b/src/libserver/redis_pool.c @@ -143,7 +143,7 @@ rspamd_redis_pool_conn_dtor (struct rspamd_redis_pool_connection *conn) g_list_free (conn->entry); } - g_slice_free1 (sizeof (*conn), conn); + g_free (conn); } static void @@ -167,7 +167,7 @@ rspamd_redis_pool_elt_dtor (gpointer p) g_queue_free (elt->active); g_queue_free (elt->inactive); - g_slice_free1 (sizeof (*elt), elt); + g_free (elt); } static void @@ -256,7 +256,7 @@ rspamd_redis_pool_new_connection (struct rspamd_redis_pool *pool, return NULL; } else { - conn = g_slice_alloc0 (sizeof (*conn)); + conn = g_malloc0 (sizeof (*conn)); conn->entry = g_list_prepend (NULL, conn); conn->elt = elt; conn->active = TRUE; @@ -291,7 +291,7 @@ rspamd_redis_pool_new_elt (struct rspamd_redis_pool *pool) { struct rspamd_redis_pool_elt *elt; - elt = g_slice_alloc0 (sizeof (*elt)); + elt = g_malloc0 (sizeof (*elt)); elt->active = g_queue_new (); elt->inactive = g_queue_new (); elt->pool = pool; @@ -304,7 +304,7 @@ rspamd_redis_pool_init (void) { struct rspamd_redis_pool *pool; - pool = g_slice_alloc0 (sizeof (*pool)); + pool = g_malloc0 (sizeof (*pool)); pool->elts_by_key = g_hash_table_new_full (g_int64_hash, g_int64_equal, NULL, rspamd_redis_pool_elt_dtor); pool->elts_by_ctx = g_hash_table_new (g_direct_hash, g_direct_equal); @@ -452,7 +452,7 @@ rspamd_redis_pool_destroy (struct rspamd_redis_pool *pool) g_hash_table_unref (pool->elts_by_ctx); g_hash_table_unref (pool->elts_by_key); - g_slice_free1 (sizeof (*pool), pool); + g_free (pool); } const gchar* diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c index 6853bb242..e669af94a 100644 --- a/src/libserver/rspamd_control.c +++ b/src/libserver/rspamd_control.c @@ -166,12 +166,12 @@ rspamd_control_connection_close (struct rspamd_control_session *session) DL_FOREACH_SAFE (session->replies, elt, telt) { event_del (&elt->io_ev); - g_slice_free1 (sizeof (*elt), elt); + g_free (elt); } rspamd_http_connection_unref (session->conn); close (session->fd); - g_slice_free1 (sizeof (*session), session); + g_free (session); } static void @@ -424,7 +424,7 @@ rspamd_control_broadcast_cmd (struct rspamd_main *rspamd_main, if (r == sizeof (*cmd)) { - rep_elt = g_slice_alloc0 (sizeof (*rep_elt)); + rep_elt = g_malloc0 (sizeof (*rep_elt)); rep_elt->wrk = wrk; rep_elt->ud = ud; event_set (&rep_elt->io_ev, wrk->control_pipe[0], @@ -506,7 +506,7 @@ rspamd_control_process_client_socket (struct rspamd_main *rspamd_main, { struct rspamd_control_session *session; - session = g_slice_alloc0 (sizeof (*session)); + session = g_malloc0 (sizeof (*session)); session->fd = fd; session->conn = rspamd_http_connection_new (NULL, @@ -669,7 +669,7 @@ rspamd_control_worker_add_default_handler (struct rspamd_worker *worker, { struct rspamd_worker_control_data *cd; - cd = g_slice_alloc0 (sizeof (*cd)); + cd = g_malloc0 (sizeof (*cd)); cd->worker = worker; cd->ev_base = ev_base; @@ -717,7 +717,7 @@ rspamd_control_hs_io_handler (gint fd, short what, gpointer ud) /* At this point we just ignore replies from the workers */ (void)read (fd, &rep, sizeof (rep)); event_del (&elt->io_ev); - g_slice_free1 (sizeof (*elt), elt); + g_free (elt); } static void @@ -729,7 +729,7 @@ rspamd_control_log_pipe_io_handler (gint fd, short what, gpointer ud) /* At this point we just ignore replies from the workers */ (void) read (fd, &rep, sizeof (rep)); event_del (&elt->io_ev); - g_slice_free1 (sizeof (*elt), elt); + g_free (elt); } static void @@ -827,7 +827,7 @@ rspamd_srv_handler (gint fd, short what, gpointer ud) (gint) r); } else { - rdata = g_slice_alloc0 (sizeof (*rdata)); + rdata = g_malloc0 (sizeof (*rdata)); rdata->worker = worker; rdata->srv = srv; rdata->rep.id = cmd.id; @@ -947,7 +947,7 @@ rspamd_srv_handler (gint fd, short what, gpointer ud) strerror (errno)); } - g_slice_free1 (sizeof (*rdata), rdata); + g_free (rdata); event_del (&worker->srv_ev); event_set (&worker->srv_ev, worker->srv_pipe[0], @@ -1062,7 +1062,7 @@ cleanup: rd->handler (rd->worker, &rd->rep, rfd, rd->ud); } event_del (&rd->io_ev); - g_slice_free1 (sizeof (*rd), rd); + g_free (rd); } void @@ -1078,7 +1078,7 @@ rspamd_srv_send_command (struct rspamd_worker *worker, g_assert (cmd != NULL); g_assert (worker != NULL); - rd = g_slice_alloc0 (sizeof (*rd)); + rd = g_malloc0 (sizeof (*rd)); cmd->id = ottery_rand_uint64 (); memcpy (&rd->cmd, cmd, sizeof (rd->cmd)); rd->handler = handler; |