From: Vsevolod Stakhov Date: Tue, 20 Oct 2015 12:47:49 +0000 (+0100) Subject: Fix memory allocation in http test X-Git-Tag: 1.0.7~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0d6a70be9f0a69165a7bab0757b0978af74231;p=thirdparty%2Frspamd.git Fix memory allocation in http test --- diff --git a/test/rspamd_http_test.c b/test/rspamd_http_test.c index 5225ed3e03..25bbc240c6 100644 --- a/test/rspamd_http_test.c +++ b/test/rspamd_http_test.c @@ -265,7 +265,7 @@ rspamd_http_test_func (void) guint i, j; pid_t *sfd; GString *b32_key; - double diff, total_diff = 0.0, latency[pconns * ntests], mean, std; + double diff, total_diff = 0.0, *latency, mean, std; rspamd_cryptobox_init (); rspamd_snprintf (filepath, sizeof (filepath), "/tmp/http-test-XXXXXX"); @@ -286,6 +286,7 @@ rspamd_http_test_func (void) } sfd = g_alloca (sizeof (*sfd) * nservers); + latency = g_malloc0 (pconns * ntests * sizeof (gdouble)); buf = g_malloc (file_size); memset (buf, 0, file_size);