diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-11 22:31:29 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-11 22:31:29 +0100 |
commit | 10fa03d65fb1b8c7b9b660c04144c4612264c9d7 (patch) | |
tree | 33e03fc218642a7ed8e16e90e1deb84029b96922 /src/main.c | |
parent | b864da214b9ca8da5c83e1e3ddf88227920ea5b5 (diff) | |
download | rspamd-10fa03d65fb1b8c7b9b660c04144c4612264c9d7.tar.gz rspamd-10fa03d65fb1b8c7b9b660c04144c4612264c9d7.zip |
Avoid useless memset.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c index 1c8f7fd41..728134132 100644 --- a/src/main.c +++ b/src/main.c @@ -1051,10 +1051,9 @@ main (gint argc, gchar **argv, gchar **env) #if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30)) g_thread_init (NULL); #endif - rspamd_main = (struct rspamd_main *)g_malloc (sizeof (struct rspamd_main)); - memset (rspamd_main, 0, sizeof (struct rspamd_main)); + rspamd_main = (struct rspamd_main *)g_malloc0 (sizeof (struct rspamd_main)); rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); - rspamd_main->cfg = (struct rspamd_config *)g_malloc (sizeof (struct rspamd_config)); + rspamd_main->cfg = (struct rspamd_config *)g_malloc0 (sizeof (struct rspamd_config)); if (!rspamd_main || !rspamd_main->cfg) { fprintf (stderr, "Cannot allocate memory\n"); @@ -1068,7 +1067,6 @@ main (gint argc, gchar **argv, gchar **env) rspamd_main->stat = rspamd_mempool_alloc_shared (rspamd_main->server_pool, sizeof (struct rspamd_stat)); memset (rspamd_main->stat, 0, sizeof (struct rspamd_stat)); - memset (rspamd_main->cfg, 0, sizeof (struct rspamd_config)); rspamd_main->cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); rspamd_config_defaults (rspamd_main->cfg); |