File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -359,22 +359,18 @@ static void set_sqlite3_func_result(sqlite3_context * ctx, VALUE result)
359359static void rb_sqlite3_func (sqlite3_context * ctx , int argc , sqlite3_value * * argv )
360360{
361361 VALUE callable = (VALUE )sqlite3_user_data (ctx );
362- VALUE * params = NULL ;
363- VALUE guard = rb_ary_new2 (argc ); /* Prevent garbage collection of params during call. */
362+ VALUE params = rb_ary_new2 (argc );
364363 VALUE result ;
365364 int i ;
366365
367366 if (argc > 0 ) {
368- params = xcalloc ((size_t )argc , sizeof (VALUE * ));
369367 for (i = 0 ; i < argc ; i ++ ) {
370368 VALUE param = sqlite3val2rb (argv [i ]);
371- rb_ary_push (guard , param );
372- params [i ] = param ;
369+ rb_ary_push (params , param );
373370 }
374371 }
375372
376- result = rb_funcall2 (callable , rb_intern ("call" ), argc , params );
377- xfree (params );
373+ result = rb_apply (callable , rb_intern ("call" ), params );
378374
379375 set_sqlite3_func_result (ctx , result );
380376}
You can’t perform that action at this time.
0 commit comments