Skip to content

Commit

Permalink
fix leak
Browse files Browse the repository at this point in the history
  • Loading branch information
BuonOmo committed Oct 13, 2022
1 parent ca01ff7 commit 3fa838d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ext/geos_c_impl/polygon.c
Expand Up @@ -252,6 +252,8 @@ cmethod_create(VALUE module,
exterior_geom = rgeo_convert_to_detached_geos_geometry(
exterior, factory, linear_ring_type, NULL, &state);
if (state) {
if (exterior_geom)
GEOSGeom_destroy(exterior_geom);
rb_exc_raise(rb_errinfo());
}
if (!exterior_geom) {
Expand All @@ -269,12 +271,12 @@ cmethod_create(VALUE module,
linear_ring_type,
NULL,
&state);
if (state || !interior_geom) {
break;
}
if (interior_geom) {
interior_geoms[actual_len++] = interior_geom;
}
if (state) {
break;
}
}
if (len == actual_len) {
polygon =
Expand Down

0 comments on commit 3fa838d

Please sign in to comment.