gbproxy: Cleanup match config after tests

Currently, patch filter configurations are leaking between tests.

This adds a call to gbproxy_clear_patch_filter() to the end of each
test that calls gbproxy_set_patch_filter().

Sponsored-by: On-Waves ehf
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index 566432a..5b298de 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -1866,6 +1866,7 @@
 	OSMO_ASSERT(!expect_msg());
 	received_messages = NULL;
 
+	gbproxy_clear_patch_filter(&gbcfg.matches[GBPROX_MATCH_PATCHING]);
 	gbprox_reset(&gbcfg);
 	gprs_ns_destroy(nsi);
 	nsi = NULL;
@@ -3218,6 +3219,7 @@
 
 	dump_global(stdout, 0);
 
+	gbproxy_clear_patch_filter(&gbcfg.matches[GBPROX_MATCH_PATCHING]);
 	gbprox_reset(&gbcfg);
 	gprs_ns_destroy(nsi);
 	nsi = NULL;
@@ -4227,6 +4229,8 @@
 
 		gbproxy_peer_free(peer);
 	}
+	gbproxy_clear_patch_filter(&cfg.matches[GBPROX_MATCH_PATCHING]);
+	gbprox_reset(&cfg);
 }
 
 static void test_gbproxy_imsi_matching(void)
@@ -4298,6 +4302,9 @@
 	OSMO_ASSERT(gbproxy_check_imsi(&match, imei2, ARRAY_SIZE(imei2)) == -1);
 
 	/* TODO: Check correct length but wrong type with is_mi_tmsi */
+
+	gbproxy_clear_patch_filter(&match);
+	OSMO_ASSERT(match.enable == 0);
 }
 
 static struct log_info_cat gprs_categories[] = {