summaryrefslogtreecommitdiffstats
path: root/src/libserver/worker_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-07 16:02:59 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-01-07 16:02:59 +0000
commit13d60df725ae1943d2085fb2c66ca24154352b6d (patch)
treeaf4ffb196abaaac05a94e2605427a8bf0a3e3324 /src/libserver/worker_util.c
parentbc23d662720ce7e8cf517da75b2655becdb81272 (diff)
downloadrspamd-13d60df725ae1943d2085fb2c66ca24154352b6d.tar.gz
rspamd-13d60df725ae1943d2085fb2c66ca24154352b6d.zip
[Minor] Try to silence intentional leak for sigaltstack
Diffstat (limited to 'src/libserver/worker_util.c')
-rw-r--r--src/libserver/worker_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 71bbe4860..7d7a50d35 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -1607,13 +1607,14 @@ rspamd_crash_sig_handler (int sig, siginfo_t *info, void *ctx)
}
#endif
-void
+RSPAMD_NO_SANITIZE void
rspamd_set_crash_handler (struct rspamd_main *rspamd_main)
{
#ifdef HAVE_SA_SIGINFO
struct sigaction sa;
#ifdef HAVE_SIGALTSTACK
+ void *stack_mem;
stack_t ss;
memset (&ss, 0, sizeof ss);
@@ -1624,7 +1625,8 @@ rspamd_set_crash_handler (struct rspamd_main *rspamd_main)
* I don't know any good ways to stop this behaviour.
*/
ss.ss_size = MAX (SIGSTKSZ, 8192 * 4);
- ss.ss_sp = g_malloc0 (ss.ss_size);
+ stack_mem = g_malloc0 (ss.ss_size);
+ ss.ss_sp = stack_mem;
sigaltstack (&ss, NULL);
#endif
saved_main = rspamd_main;