diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-14 20:17:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-14 20:17:36 +0100 |
commit | 9b3949e02de3292c42bf659cb1f0dfe234d0afa9 (patch) | |
tree | 3b8961f45a1fa1bb7abc7fcc07102fe30b81a4f2 /src/rspamd_proxy.c | |
parent | 958715d7faef07ad788b90591e2f2d6fafb9e383 (diff) | |
download | rspamd-9b3949e02de3292c42bf659cb1f0dfe234d0afa9.tar.gz rspamd-9b3949e02de3292c42bf659cb1f0dfe234d0afa9.zip |
[Minor] Explicitly reset all fields in context on init
Diffstat (limited to 'src/rspamd_proxy.c')
-rw-r--r-- | src/rspamd_proxy.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index 50567e32e..97215d7c4 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -601,7 +601,7 @@ init_rspamd_proxy (struct rspamd_config *cfg) type = g_quark_try_string ("rspamd_proxy"); - ctx = rspamd_mempool_alloc (cfg->cfg_pool, + ctx = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (struct rspamd_proxy_ctx)); ctx->magic = rspamd_rspamd_proxy_magic; ctx->timeout = 10.0; @@ -624,8 +624,7 @@ init_rspamd_proxy (struct rspamd_config *cfg) "timeout", rspamd_rcl_parse_struct_time, ctx, - G_STRUCT_OFFSET (struct rspamd_proxy_ctx, - timeout), + G_STRUCT_OFFSET (struct rspamd_proxy_ctx, timeout), RSPAMD_CL_FLAG_TIME_FLOAT, "IO timeout"); rspamd_rcl_register_worker_option (cfg, @@ -633,8 +632,7 @@ init_rspamd_proxy (struct rspamd_config *cfg) "rotate", rspamd_rcl_parse_struct_time, ctx, - G_STRUCT_OFFSET (struct rspamd_proxy_ctx, - rotate_tm), + G_STRUCT_OFFSET (struct rspamd_proxy_ctx, rotate_tm), RSPAMD_CL_FLAG_TIME_FLOAT, "Rotation keys time, default: " G_STRINGIFY (DEFAULT_ROTATION_TIME) " seconds"); @@ -643,8 +641,7 @@ init_rspamd_proxy (struct rspamd_config *cfg) "keypair", rspamd_rcl_parse_struct_keypair, ctx, - G_STRUCT_OFFSET (struct rspamd_proxy_ctx, - key), + G_STRUCT_OFFSET (struct rspamd_proxy_ctx, key), 0, "Server's keypair"); rspamd_rcl_register_worker_option (cfg, |