Skip to content

Commit

Permalink
fix leak 2
Browse files Browse the repository at this point in the history
  • Loading branch information
BuonOmo committed Oct 14, 2022
1 parent 3fa838d commit fc01fce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ext/geos_c_impl/ruby_more.c
Expand Up @@ -33,6 +33,7 @@ rb_protect_funcall(VALUE recv, ID mid, int* state, int n, ...)
{
struct funcall_args args;
VALUE* argv;
VALUE result;
va_list ar;

if (n > 0) {
Expand All @@ -52,7 +53,12 @@ rb_protect_funcall(VALUE recv, ID mid, int* state, int n, ...)
args.argc = n;
args.argv = argv;

return rb_protect(inner_funcall, (VALUE)&args, state);
result = rb_protect(inner_funcall, (VALUE)&args, state);

if (n > 0)
RB_FREE(argv);

return result;
}

RGEO_END_C
Expand Down

0 comments on commit fc01fce

Please sign in to comment.