@@ -354,7 +354,7 @@ static VALUE rb_git_remote_ls(int argc, VALUE *argv, VALUE self)
354354 cleanup :
355355
356356 git_remote_disconnect (remote );
357- xfree ( custom_headers . strings );
357+ rugged_strarray_dispose ( & custom_headers );
358358
359359 if (payload .exception )
360360 rb_jump_tag (payload .exception );
@@ -527,7 +527,7 @@ static VALUE rb_git_remote_check_connection(int argc, VALUE *argv, VALUE self)
527527 git_remote * remote ;
528528 git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT ;
529529 git_proxy_options proxy_options = GIT_PROXY_OPTIONS_INIT ;
530- git_strarray custom_headers = {0 };
530+ git_strarray custom_headers = { NULL , 0 };
531531 struct rugged_remote_cb_payload payload = { Qnil , Qnil , Qnil , Qnil , Qnil , Qnil , Qnil , 0 };
532532 VALUE rb_direction , rb_options ;
533533 ID id_direction ;
@@ -552,7 +552,7 @@ static VALUE rb_git_remote_check_connection(int argc, VALUE *argv, VALUE self)
552552 error = git_remote_connect (remote , direction , & callbacks , & proxy_options , & custom_headers );
553553 git_remote_disconnect (remote );
554554
555- xfree ( custom_headers . strings );
555+ rugged_strarray_dispose ( & custom_headers );
556556
557557 if (payload .exception )
558558 rb_jump_tag (payload .exception );
@@ -655,8 +655,8 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
655655
656656 error = git_remote_fetch (remote , & refspecs , & opts , log_message );
657657
658- xfree ( refspecs . strings );
659- xfree ( opts .custom_headers . strings );
658+ rugged_strarray_dispose ( & refspecs );
659+ rugged_strarray_dispose ( & opts .custom_headers );
660660
661661 if (payload .exception )
662662 rb_jump_tag (payload .exception );
@@ -740,8 +740,8 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
740740
741741 error = git_remote_push (remote , & refspecs , & opts );
742742
743- xfree ( refspecs . strings );
744- xfree ( opts .custom_headers . strings );
743+ rugged_strarray_dispose ( & refspecs );
744+ rugged_strarray_dispose ( & opts .custom_headers );
745745
746746 if (payload .exception )
747747 rb_jump_tag (payload .exception );
0 commit comments