]> source.dussan.org Git - rspamd.git/commitdiff
Fix memory allocation in http test
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Oct 2015 12:47:49 +0000 (13:47 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Oct 2015 12:47:49 +0000 (13:47 +0100)
test/rspamd_http_test.c

index 5225ed3e03aecb5755291e9507d7d49628955f7c..25bbc240c66de7ace0e8baea62bd1a0c924e0d11 100644 (file)
@@ -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);