From 96346543001368d5ee1a3b19a4315ad2a5fd3e13 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 2 Nov 2014 19:03:15 +0000 Subject: [PATCH] Some more fixes to the test. --- src/libutil/upstream.c | 3 +++ test/rspamd_upstream_test.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libutil/upstream.c b/src/libutil/upstream.c index b18e2585f..2ff8f2651 100644 --- a/src/libutil/upstream.c +++ b/src/libutil/upstream.c @@ -367,6 +367,9 @@ rspamd_upstreams_parse_line (struct upstream_list *ups, if (rspamd_upstreams_add_upstream (ups, tmp, def_port, data)) { ret = TRUE; } + else { + g_free (tmp); + } } p += len; /* Skip separators */ diff --git a/test/rspamd_upstream_test.c b/test/rspamd_upstream_test.c index 531f0bd27..5c25f120d 100644 --- a/test/rspamd_upstream_test.c +++ b/test/rspamd_upstream_test.c @@ -27,7 +27,7 @@ #include "main.h" #include "upstream.h" -const char *test_upstream_list = "microsoft.com:443:1,google.com:2,kernel.org:443:3"; +const char *test_upstream_list = "microsoft.com:443:1,google.com:80:2,kernel.org:443:3"; static void @@ -69,5 +69,8 @@ rspamd_upstream_test_func (void) /* Test round-robin rotation */ rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "kernel.org"); rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "google.com"); + rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "kernel.org"); rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "microsoft.com"); + rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "google.com"); + rspamd_upstream_test_method (ls, RSPAMD_UPSTREAM_ROUND_ROBIN, "kernel.org"); } -- 2.39.5