[postgis-tickets] r16672 - cu_in_wkt: Fix memory leaks in tests

Raul raul at rmr.ninja
Fri Jul 27 04:28:00 PDT 2018


Author: algunenano
Date: 2018-07-27 04:28:00 -0700 (Fri, 27 Jul 2018)
New Revision: 16672

Modified:
   trunk/liblwgeom/cunit/cu_in_wkt.c
Log:
cu_in_wkt: Fix memory leaks in tests

Introduced in #4109



Modified: trunk/liblwgeom/cunit/cu_in_wkt.c
===================================================================
--- trunk/liblwgeom/cunit/cu_in_wkt.c	2018-07-25 20:34:03 UTC (rev 16671)
+++ trunk/liblwgeom/cunit/cu_in_wkt.c	2018-07-27 11:28:00 UTC (rev 16672)
@@ -356,27 +356,30 @@
 	lwgeom_parser_result_init(&p);
 	rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
 	CU_ASSERT_EQUAL( rv, LW_FAILURE );
+	lwgeom_parser_result_free(&p);
 
 	wkt = "LINESTRING(1.1 .1, 2.2 .2)";
 	lwgeom_parser_result_init(&p);
 	rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
 	CU_ASSERT_EQUAL( rv, LW_SUCCESS );
+	lwgeom_parser_result_free(&p);
 
 	wkt = "LINESTRING(    1.1    .1    ,    2.2   .2    )";
 	lwgeom_parser_result_init(&p);
 	rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
 	CU_ASSERT_EQUAL( rv, LW_SUCCESS );
+	lwgeom_parser_result_free(&p);
 
 	wkt = "LINESTRING(\n1.1\n.1,\n2.2\n.2\n)";
 	lwgeom_parser_result_init(&p);
 	rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
 	CU_ASSERT_EQUAL( rv, LW_SUCCESS );
+	lwgeom_parser_result_free(&p);
 
 	wkt = "LINESTRING(1.1\t.1\t,\t2.2\t.2\t)";
 	lwgeom_parser_result_init(&p);
 	rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
 	CU_ASSERT_EQUAL( rv, LW_SUCCESS );
-
 	lwgeom_parser_result_free(&p);
 }
 
@@ -403,4 +406,4 @@
 	PG_ADD_TEST(suite, test_wkt_in_polyhedralsurface);
 	PG_ADD_TEST(suite, test_wkt_in_errlocation);
 	PG_ADD_TEST(suite, test_wkt_double);
-}
\ No newline at end of file
+}



More information about the postgis-tickets mailing list