]> granicus.if.org Git - postgis/commitdiff
cu_in_wkt: Fix memory leaks in tests
authorRaúl Marín Rodríguez <rmrodriguez@carto.com>
Fri, 27 Jul 2018 11:28:00 +0000 (11:28 +0000)
committerRaúl Marín Rodríguez <rmrodriguez@carto.com>
Fri, 27 Jul 2018 11:28:00 +0000 (11:28 +0000)
Introduced in #4109

git-svn-id: http://svn.osgeo.org/postgis/trunk@16672 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_in_wkt.c

index adc615f74d72b1f735e96d6fa77dbdea3ba0d5b8..644136c2b4c70d498b37348d0b3d632b357a0268 100644 (file)
@@ -356,27 +356,30 @@ static void test_wkt_double(void)
        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 @@ void wkt_in_suite_setup(void)
        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
+}