diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-28 15:14:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-28 15:14:33 +0100 |
commit | b2b9cfa6161a98d5d4d074573f99fdac6cb24556 (patch) | |
tree | 7d531529f1798da141faeb17b0df1b47fc08896a /src/libutil | |
parent | 4656f5525d110e3951672ad66a29cfb395f7d32f (diff) | |
download | rspamd-b2b9cfa6161a98d5d4d074573f99fdac6cb24556.tar.gz rspamd-b2b9cfa6161a98d5d4d074573f99fdac6cb24556.zip |
[Minor] Further portion of g_slice elimination
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/addr.c | 10 | ||||
-rw-r--r-- | src/libutil/aio_event.c | 6 | ||||
-rw-r--r-- | src/libutil/expression.c | 4 | ||||
-rw-r--r-- | src/libutil/fstring.c | 4 | ||||
-rw-r--r-- | src/libutil/hash.c | 4 | ||||
-rw-r--r-- | src/libutil/heap.c | 4 | ||||
-rw-r--r-- | src/libutil/http.c | 50 | ||||
-rw-r--r-- | src/libutil/logger.c | 2 | ||||
-rw-r--r-- | src/libutil/map.c | 34 | ||||
-rw-r--r-- | src/libutil/multipattern.c | 8 | ||||
-rw-r--r-- | src/libutil/radix.c | 4 | ||||
-rw-r--r-- | src/libutil/ssl_util.c | 4 |
12 files changed, 67 insertions, 67 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c index b4ee003ba..765046dec 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -109,10 +109,10 @@ rspamd_inet_addr_create (gint af) { rspamd_inet_addr_t *addr; - addr = g_slice_alloc0 (sizeof (rspamd_inet_addr_t)); + addr = g_malloc0 (sizeof (rspamd_inet_addr_t)); if (af == AF_UNIX) { - addr->u.un = g_slice_alloc0 (sizeof (*addr->u.un)); + addr->u.un = g_malloc0 (sizeof (*addr->u.un)); addr->slen = sizeof (addr->u.un->addr); } @@ -129,10 +129,10 @@ rspamd_inet_address_free (rspamd_inet_addr_t *addr) if (addr) { if (addr->af == AF_UNIX) { if (addr->u.un) { - g_slice_free1 (sizeof (*addr->u.un), addr->u.un); + g_free (addr->u.un); } } - g_slice_free1 (sizeof (rspamd_inet_addr_t), addr); + g_free (addr); } } @@ -1096,7 +1096,7 @@ rspamd_inet_address_recvfrom (gint fd, void *buf, gsize len, gint fl, addr->slen = slen; if (addr->af == AF_UNIX) { - addr->u.un = g_slice_alloc (sizeof (*addr->u.un)); + addr->u.un = g_malloc (sizeof (*addr->u.un)); memcpy (&addr->u.un->addr, &su.su, sizeof (struct sockaddr_un)); } else { diff --git a/src/libutil/aio_event.c b/src/libutil/aio_event.c index 3e83cf979..584feb501 100644 --- a/src/libutil/aio_event.c +++ b/src/libutil/aio_event.c @@ -231,7 +231,7 @@ rspamd_eventfdcb (gint fd, gshort what, gpointer ud) if (ev_data->io_buf) { free (ev_data->io_buf); } - g_slice_free1 (sizeof (struct io_cbdata), ev_data); + g_free (ev_data); } } else if (done == 0) { @@ -337,7 +337,7 @@ rspamd_aio_read (gint fd, struct iocb *iocb[1]; struct io_cbdata *cbdata; - cbdata = g_slice_alloc (sizeof (struct io_cbdata)); + cbdata = g_malloc0 (sizeof (struct io_cbdata)); cbdata->cb = cb; cbdata->buf = buf; cbdata->len = len; @@ -414,7 +414,7 @@ rspamd_aio_write (gint fd, struct iocb *iocb[1]; struct io_cbdata *cbdata; - cbdata = g_slice_alloc (sizeof (struct io_cbdata)); + cbdata = g_malloc0 (sizeof (struct io_cbdata)); cbdata->cb = cb; cbdata->buf = buf; cbdata->len = len; diff --git a/src/libutil/expression.c b/src/libutil/expression.c index dae574da5..3f631d918 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -366,7 +366,7 @@ rspamd_expression_destroy (struct rspamd_expression *expr) g_node_destroy (expr->ast); } - g_slice_free1 (sizeof (*expr), expr); + g_free (expr); } } @@ -598,7 +598,7 @@ rspamd_parse_expression (const gchar *line, gsize len, p = line; c = line; end = line + len; - e = g_slice_alloc (sizeof (*e)); + e = g_malloc0 (sizeof (*e)); e->expressions = g_array_new (FALSE, FALSE, sizeof (struct rspamd_expression_elt)); operand_stack = g_ptr_array_sized_new (32); diff --git a/src/libutil/fstring.c b/src/libutil/fstring.c index 101bfa9f0..8b5cae65b 100644 --- a/src/libutil/fstring.c +++ b/src/libutil/fstring.c @@ -383,7 +383,7 @@ rspamd_fstring_mapped_ftok_free (gpointer p) storage = (rspamd_fstring_t *) (tok->begin - 2 * sizeof (gsize)); rspamd_fstring_free (storage); - g_slice_free1 (sizeof (*tok), tok); + g_free (tok); } rspamd_ftok_t * @@ -393,7 +393,7 @@ rspamd_ftok_map (const rspamd_fstring_t *s) g_assert (s != NULL); - tok = g_slice_alloc (sizeof (*tok)); + tok = g_malloc (sizeof (*tok)); tok->begin = s->str; tok->len = s->len; diff --git a/src/libutil/hash.c b/src/libutil/hash.c index 1afe947ee..18b01f2ec 100644 --- a/src/libutil/hash.c +++ b/src/libutil/hash.c @@ -60,7 +60,7 @@ rspamd_lru_destroy_node (gpointer value) elt->hash->value_destroy (elt->data); } - g_slice_free1 (sizeof (*elt), elt); + g_free (elt); } } @@ -190,7 +190,7 @@ rspamd_lru_create_node (rspamd_lru_hash_t *hash, { rspamd_lru_element_t *node; - node = g_slice_alloc (sizeof (rspamd_lru_element_t)); + node = g_malloc (sizeof (rspamd_lru_element_t)); node->data = value; node->key = key; node->ttl = TIME_TO_TS (ttl); diff --git a/src/libutil/heap.c b/src/libutil/heap.c index ae8e14131..601eb7893 100644 --- a/src/libutil/heap.c +++ b/src/libutil/heap.c @@ -90,7 +90,7 @@ rspamd_min_heap_create (gsize reserved_size) { struct rspamd_min_heap *heap; - heap = g_slice_alloc (sizeof (*heap)); + heap = g_malloc (sizeof (*heap)); heap->ar = g_ptr_array_sized_new (reserved_size); return heap; @@ -185,7 +185,7 @@ rspamd_min_heap_destroy (struct rspamd_min_heap *heap) { if (heap) { g_ptr_array_free (heap->ar, TRUE); - g_slice_free1 (sizeof (*heap), heap); + g_free (heap); } } diff --git a/src/libutil/http.c b/src/libutil/http.c index 5832f0007..60378f8a1 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -125,7 +125,7 @@ rspamd_http_privbuf_dtor (gpointer ud) rspamd_fstring_free (p->data); } - g_slice_free1 (sizeof (struct _rspamd_http_privbuf), p); + g_free (p); } static const gchar * @@ -549,7 +549,7 @@ rspamd_http_finish_header (struct rspamd_http_connection *conn, static void rspamd_http_init_header (struct rspamd_http_connection_private *priv) { - priv->header = g_slice_alloc0 (sizeof (struct rspamd_http_header)); + priv->header = g_malloc0 (sizeof (struct rspamd_http_header)); priv->header->combined = rspamd_fstring_new (); } @@ -860,7 +860,7 @@ rspamd_http_decrypt_message (struct rspamd_http_connection *conn, DL_FOREACH_SAFE (hdr, hcur, hcurtmp) { rspamd_fstring_free (hcur->combined); - g_slice_free1 (sizeof (struct rspamd_http_header), hcur); + g_free (hcur); } } @@ -1310,7 +1310,7 @@ rspamd_http_connection_new ( return NULL; } - conn = g_slice_alloc0 (sizeof (struct rspamd_http_connection)); + conn = g_malloc0 (sizeof (struct rspamd_http_connection)); conn->opts = opts; conn->type = type; conn->body_handler = body_handler; @@ -1322,7 +1322,7 @@ rspamd_http_connection_new ( conn->cache = cache; /* Init priv */ - priv = g_slice_alloc0 (sizeof (struct rspamd_http_connection_private)); + priv = g_malloc0 (sizeof (struct rspamd_http_connection_private)); conn->priv = priv; priv->ssl_ctx = ssl_ctx; @@ -1369,7 +1369,7 @@ rspamd_http_connection_reset (struct rspamd_http_connection *conn) } if (priv->out != NULL) { - g_slice_free1 (sizeof (struct iovec) * priv->outlen, priv->out); + g_free (priv->out); priv->out = NULL; } @@ -1485,7 +1485,7 @@ rspamd_http_connection_copy_msg (struct rspamd_http_message *msg) nhdrs = NULL; DL_FOREACH (hdr, hcur) { - nhdr = g_slice_alloc (sizeof (struct rspamd_http_header)); + nhdr = g_malloc (sizeof (struct rspamd_http_header)); nhdr->combined = rspamd_fstring_new_init (hcur->combined->str, hcur->combined->len); @@ -1527,10 +1527,10 @@ rspamd_http_connection_free (struct rspamd_http_connection *conn) rspamd_pubkey_unref (priv->peer_key); } - g_slice_free1 (sizeof (struct rspamd_http_connection_private), priv); + g_free (priv); } - g_slice_free1 (sizeof (struct rspamd_http_connection), conn); + g_free (conn); } static void @@ -1567,7 +1567,7 @@ rspamd_http_connection_read_message_common (struct rspamd_http_connection *conn, } priv->header = NULL; - priv->buf = g_slice_alloc0 (sizeof (*priv->buf)); + priv->buf = g_malloc0 (sizeof (*priv->buf)); REF_INIT_RETAIN (priv->buf, rspamd_http_privbuf_dtor); priv->buf->data = rspamd_fstring_sized_new (8192); priv->flags |= RSPAMD_HTTP_CONN_FLAG_NEW_HEADER; @@ -1992,7 +1992,7 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn } priv->header = NULL; - priv->buf = g_slice_alloc0 (sizeof (*priv->buf)); + priv->buf = g_malloc0 (sizeof (*priv->buf)); REF_INIT_RETAIN (priv->buf, rspamd_http_privbuf_dtor); priv->buf->data = rspamd_fstring_sized_new (512); buf = priv->buf->data; @@ -2183,7 +2183,7 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn } /* Allocate iov */ - priv->out = g_slice_alloc (sizeof (struct iovec) * priv->outlen); + priv->out = g_malloc0 (sizeof (struct iovec) * priv->outlen); priv->wr_pos = 0; meth_len = rspamd_http_message_write_header (mime_type, encrypted, @@ -2346,7 +2346,7 @@ rspamd_http_new_message (enum http_parser_type type) { struct rspamd_http_message *new; - new = g_slice_alloc0 (sizeof (struct rspamd_http_message)); + new = g_malloc0 (sizeof (struct rspamd_http_message)); if (type == HTTP_REQUEST) { new->url = rspamd_fstring_new (); @@ -2460,7 +2460,7 @@ rspamd_http_shname_dtor (void *p) unlink (n->shm_name); #endif g_free (n->shm_name); - g_slice_free1 (sizeof (*n), n); + g_free (n); } struct rspamd_storage_shmem * @@ -2496,7 +2496,7 @@ rspamd_http_message_set_body (struct rspamd_http_message *msg, rspamd_http_message_storage_cleanup (msg); if (msg->flags & RSPAMD_HTTP_FLAG_SHMEM) { - storage->shared.name = g_slice_alloc (sizeof (*storage->shared.name)); + storage->shared.name = g_malloc (sizeof (*storage->shared.name)); REF_INIT_RETAIN (storage->shared.name, rspamd_http_shname_dtor); #ifdef HAVE_SANE_SHMEM #if defined(__DragonFly__) @@ -2803,7 +2803,7 @@ rspamd_http_message_free (struct rspamd_http_message *msg) DL_FOREACH_SAFE (hdr, hcur, hcurtmp) { rspamd_fstring_free (hcur->combined); - g_slice_free1 (sizeof (struct rspamd_http_header), hcur); + g_free (hcur); } } @@ -2823,7 +2823,7 @@ rspamd_http_message_free (struct rspamd_http_message *msg) rspamd_pubkey_unref (msg->peer_key); } - g_slice_free1 (sizeof (struct rspamd_http_message), msg); + g_free (msg); } void @@ -2852,7 +2852,7 @@ rspamd_http_message_add_header_len (struct rspamd_http_message *msg, guint nlen, vlen; if (msg != NULL && name != NULL && value != NULL) { - hdr = g_slice_alloc (sizeof (struct rspamd_http_header)); + hdr = g_malloc0 (sizeof (struct rspamd_http_header)); nlen = strlen (name); vlen = len; hdr->combined = rspamd_fstring_sized_new (nlen + vlen + 4); @@ -2894,7 +2894,7 @@ rspamd_http_message_add_header_fstr (struct rspamd_http_message *msg, guint nlen, vlen; if (msg != NULL && name != NULL && value != NULL) { - hdr = g_slice_alloc (sizeof (struct rspamd_http_header)); + hdr = g_malloc0 (sizeof (struct rspamd_http_header)); nlen = strlen (name); vlen = value->len; hdr->combined = rspamd_fstring_sized_new (nlen + vlen + 4); @@ -2979,7 +2979,7 @@ rspamd_http_message_remove_header (struct rspamd_http_message *msg, DL_FOREACH_SAFE (hdr, hcur, hcurtmp) { rspamd_fstring_free (hcur->combined); - g_slice_free1 (sizeof (*hcur), hcur); + g_free (hcur); } } } @@ -3002,7 +3002,7 @@ rspamd_http_entry_free (struct rspamd_http_connection_entry *entry) } DL_DELETE (entry->rt->conns, entry); - g_slice_free1 (sizeof (struct rspamd_http_connection_entry), entry); + g_free (entry); } } @@ -3321,7 +3321,7 @@ rspamd_http_router_new (rspamd_http_router_error_handler_t eh, struct rspamd_http_connection_router * new; struct stat st; - new = g_slice_alloc0 (sizeof (struct rspamd_http_connection_router)); + new = g_malloc0 (sizeof (struct rspamd_http_connection_router)); new->paths = g_hash_table_new_full (rspamd_ftok_icase_hash, rspamd_ftok_icase_equal, rspamd_fstring_mapped_ftok_free, NULL); new->regexps = g_ptr_array_new (); @@ -3383,7 +3383,7 @@ rspamd_http_router_add_path (struct rspamd_http_connection_router *router, if (path != NULL && handler != NULL && router != NULL) { memcpy (&ptr, &handler, sizeof (ptr)); storage = rspamd_fstring_new_init (path, strlen (path)); - key = g_slice_alloc0 (sizeof (*key)); + key = g_malloc0 (sizeof (*key)); key->begin = storage->str; key->len = storage->len; g_hash_table_insert (router->paths, key, ptr); @@ -3446,7 +3446,7 @@ rspamd_http_router_handle_socket (struct rspamd_http_connection_router *router, { struct rspamd_http_connection_entry *conn; - conn = g_slice_alloc0 (sizeof (struct rspamd_http_connection_entry)); + conn = g_malloc0 (sizeof (struct rspamd_http_connection_entry)); conn->rt = router; conn->ud = ud; conn->is_reply = FALSE; @@ -3500,7 +3500,7 @@ rspamd_http_router_free (struct rspamd_http_connection_router *router) g_ptr_array_free (router->regexps, TRUE); g_hash_table_unref (router->paths); g_hash_table_unref (router->response_headers); - g_slice_free1 (sizeof (struct rspamd_http_connection_router), router); + g_free (router); } } diff --git a/src/libutil/logger.c b/src/libutil/logger.c index de301cc62..7bfd85183 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -371,7 +371,7 @@ rspamd_set_logger (struct rspamd_config *cfg, rspamd_logger_t *logger; if (plogger == NULL || *plogger == NULL) { - logger = g_slice_alloc0 (sizeof (rspamd_logger_t)); + logger = g_malloc0 (sizeof (rspamd_logger_t)); if (cfg->log_error_elts > 0 && pool) { logger->errlog = rspamd_mempool_alloc0_shared (pool, diff --git a/src/libutil/map.c b/src/libutil/map.c index 892bf0e0c..6327b426b 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -277,7 +277,7 @@ free_http_cbdata_common (struct http_callback_data *cbd, gboolean plan_new) MAP_RELEASE (cbd->bk, "rspamd_map_backend"); MAP_RELEASE (periodic, "periodic"); - g_slice_free1 (sizeof (struct http_callback_data), cbd); + g_free (cbd); } static void @@ -346,7 +346,7 @@ rspamd_map_cache_cb (gint fd, short what, gpointer ud) MAP_RELEASE (cache_cbd->shm, "rspamd_http_map_cached_cbdata"); msg_debug_map ("cached data is now expired (gen missmatch) for %s", map->name); event_del (&cache_cbd->timeout); - g_slice_free1 (sizeof (*cache_cbd), cache_cbd); + g_free (cache_cbd); } else if (cache_cbd->data->last_checked > cache_cbd->last_checked) { /* @@ -363,7 +363,7 @@ rspamd_map_cache_cb (gint fd, short what, gpointer ud) MAP_RELEASE (cache_cbd->shm, "rspamd_http_map_cached_cbdata"); msg_debug_map ("cached data is now expired for %s", map->name); event_del (&cache_cbd->timeout); - g_slice_free1 (sizeof (*cache_cbd), cache_cbd); + g_free (cache_cbd); } } @@ -636,7 +636,7 @@ read_data: sizeof (map->cache->shmem_name)); map->cache->len = cbd->data_len; map->cache->last_modified = cbd->data->last_modified; - cache_cbd = g_slice_alloc0 (sizeof (*cache_cbd)); + cache_cbd = g_malloc0 (sizeof (*cache_cbd)); cache_cbd->shm = cbd->shmem_data; cache_cbd->map = map; cache_cbd->data = cbd->data; @@ -986,7 +986,7 @@ rspamd_map_periodic_dtor (struct map_periodic_cbdata *periodic) msg_debug_map ("unlocked map"); } - g_slice_free1 (sizeof (*periodic), periodic); + g_free (periodic); } static void @@ -1037,7 +1037,7 @@ rspamd_map_schedule_periodic (struct rspamd_map *map, jittered_sec = rspamd_time_jitter (timeout, 0); } - cbd = g_slice_alloc0 (sizeof (*cbd)); + cbd = g_malloc0 (sizeof (*cbd)); cbd->cbdata.state = 0; cbd->cbdata.prev_data = *map->user_data; cbd->cbdata.cur_data = NULL; @@ -1267,7 +1267,7 @@ rspamd_map_common_http_callback (struct rspamd_map *map, } check: - cbd = g_slice_alloc0 (sizeof (struct http_callback_data)); + cbd = g_malloc0 (sizeof (struct http_callback_data)); cbd->ev_base = map->ev_base; cbd->map = map; @@ -1741,7 +1741,7 @@ rspamd_map_backend_dtor (struct rspamd_map_backend *bk) case MAP_PROTO_FILE: if (bk->data.fd) { g_free (bk->data.fd->filename); - g_slice_free1 (sizeof (*bk->data.fd), bk->data.fd); + g_free (bk->data.fd); } break; case MAP_PROTO_STATIC: @@ -1756,7 +1756,7 @@ rspamd_map_backend_dtor (struct rspamd_map_backend *bk) if (bk->data.hd) { g_free (bk->data.hd->host); g_free (bk->data.hd->path); - g_slice_free1 (sizeof (*bk->data.hd), bk->data.hd); + g_free (bk->data.hd); } break; } @@ -1765,7 +1765,7 @@ rspamd_map_backend_dtor (struct rspamd_map_backend *bk) rspamd_pubkey_unref (bk->trusted_pubkey); } - g_slice_free1 (sizeof (*bk), bk); + g_free (bk); } static struct rspamd_map_backend * @@ -1779,7 +1779,7 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line) const gchar *end, *p; rspamd_ftok_t tok; - bk = g_slice_alloc0 (sizeof (*bk)); + bk = g_malloc0 (sizeof (*bk)); REF_INIT_RETAIN (bk, rspamd_map_backend_dtor); if (!rspamd_map_check_proto (cfg, map_line, bk)) { @@ -1800,7 +1800,7 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line) /* Now check for each proto separately */ if (bk->protocol == MAP_PROTO_FILE) { - fdata = g_slice_alloc0 (sizeof (struct file_map_data)); + fdata = g_malloc0 (sizeof (struct file_map_data)); fdata->st.st_mtime = -1; if (access (bk->uri, R_OK) == -1) { @@ -1818,7 +1818,7 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line) bk->data.fd = fdata; } else if (bk->protocol == MAP_PROTO_HTTP || bk->protocol == MAP_PROTO_HTTPS) { - hdata = g_slice_alloc0 (sizeof (struct http_map_data)); + hdata = g_malloc0 (sizeof (struct http_map_data)); memset (&up, 0, sizeof (up)); if (http_parser_parse_url (bk->uri, strlen (bk->uri), FALSE, @@ -1858,7 +1858,7 @@ rspamd_map_parse_backend (struct rspamd_config *cfg, const gchar *map_line) bk->data.hd = hdata; }else if (bk->protocol == MAP_PROTO_STATIC) { - sdata = g_slice_alloc0 (sizeof (*sdata)); + sdata = g_malloc0 (sizeof (*sdata)); bk->data.sd = sdata; } @@ -1871,7 +1871,7 @@ err: MAP_RELEASE (bk, "rspamd_map_backend"); if (hdata) { - g_slice_free1 (sizeof (*hdata), hdata); + g_free (hdata); } return NULL; @@ -2647,7 +2647,7 @@ rspamd_regexp_map_create (struct rspamd_map *map, { struct rspamd_regexp_map *re_map; - re_map = g_slice_alloc0 (sizeof (*re_map)); + re_map = g_malloc0 (sizeof (*re_map)); re_map->values = g_ptr_array_new (); re_map->regexps = g_ptr_array_new (); re_map->map = map; @@ -2693,7 +2693,7 @@ rspamd_regexp_map_destroy (struct rspamd_regexp_map *re_map) } #endif - g_slice_free1 (sizeof (*re_map), re_map); + g_free (re_map); } static void diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c index 508ffcda9..e55b5d0b5 100644 --- a/src/libutil/multipattern.c +++ b/src/libutil/multipattern.c @@ -338,7 +338,7 @@ rspamd_multipattern_create (enum rspamd_multipattern_flags flags) { struct rspamd_multipattern *mp; - mp = g_slice_alloc0 (sizeof (*mp)); + mp = g_malloc0 (sizeof (*mp)); mp->flags = flags; #ifdef WITH_HYPERSCAN @@ -363,7 +363,7 @@ rspamd_multipattern_create_sized (guint npatterns, { struct rspamd_multipattern *mp; - mp = g_slice_alloc0 (sizeof (*mp)); + mp = g_malloc0 (sizeof (*mp)); mp->flags = flags; #ifdef WITH_HYPERSCAN @@ -744,7 +744,7 @@ rspamd_multipattern_destroy (struct rspamd_multipattern *mp) g_array_free (mp->hs_pats, TRUE); g_array_free (mp->hs_ids, TRUE); g_array_free (mp->hs_flags, TRUE); - g_slice_free1 (sizeof (*mp), mp); + g_free (mp); return; } @@ -762,7 +762,7 @@ rspamd_multipattern_destroy (struct rspamd_multipattern *mp) g_array_free (mp->pats, TRUE); - g_slice_free1 (sizeof (*mp), mp); + g_free (mp); } } diff --git a/src/libutil/radix.c b/src/libutil/radix.c index b44391bfc..bb295d7d1 100644 --- a/src/libutil/radix.c +++ b/src/libutil/radix.c @@ -114,7 +114,7 @@ radix_create_compressed (void) { radix_compressed_t *tree; - tree = g_slice_alloc (sizeof (*tree)); + tree = g_malloc0 (sizeof (*tree)); if (tree == NULL) { return NULL; } @@ -131,7 +131,7 @@ radix_destroy_compressed (radix_compressed_t *tree) { if (tree) { rspamd_mempool_delete (tree->pool); - g_slice_free1 (sizeof (*tree), tree); + g_free (tree); } } diff --git a/src/libutil/ssl_util.c b/src/libutil/ssl_util.c index 6d76beabd..a90bd5e36 100644 --- a/src/libutil/ssl_util.c +++ b/src/libutil/ssl_util.c @@ -474,7 +474,7 @@ rspamd_ssl_connection_new (gpointer ssl_ctx, struct event_base *ev_base, struct rspamd_ssl_connection *c; g_assert (ssl_ctx != NULL); - c = g_slice_alloc0 (sizeof (*c)); + c = g_malloc0 (sizeof (*c)); c->ssl = SSL_new (ssl_ctx); c->ev_base = ev_base; c->verify_peer = verify_peer; @@ -753,6 +753,6 @@ rspamd_ssl_connection_free (struct rspamd_ssl_connection *conn) g_free (conn->hostname); } - g_slice_free1 (sizeof (*conn), conn); + g_free (conn); } } |