Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions ext/rugged/rugged_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ static VALUE rb_git_remote_ls(int argc, VALUE *argv, VALUE self)
cleanup:

git_remote_disconnect(remote);
xfree(custom_headers.strings);
if (custom_headers.strings)
xfree(custom_headers.strings);

if (payload.exception)
rb_jump_tag(payload.exception);
Expand Down Expand Up @@ -541,7 +542,8 @@ static VALUE rb_git_remote_check_connection(int argc, VALUE *argv, VALUE self)
error = git_remote_connect(remote, direction, &callbacks, &proxy_options, &custom_headers);
git_remote_disconnect(remote);

xfree(custom_headers.strings);
if (custom_headers.strings)
xfree(custom_headers.strings);

if (payload.exception)
rb_jump_tag(payload.exception);
Expand Down Expand Up @@ -644,8 +646,10 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)

error = git_remote_fetch(remote, &refspecs, &opts, log_message);

xfree(refspecs.strings);
xfree(opts.custom_headers.strings);
if (refspecs.strings)
xfree(refspecs.strings);
if (opts.custom_headers.strings)
xfree(opts.custom_headers.strings);

if (payload.exception)
rb_jump_tag(payload.exception);
Expand Down Expand Up @@ -729,8 +733,10 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)

error = git_remote_push(remote, &refspecs, &opts);

xfree(refspecs.strings);
xfree(opts.custom_headers.strings);
if (refspecs.strings)
xfree(refspecs.strings);
if (opts.custom_headers.strings)
xfree(opts.custom_headers.strings);

if (payload.exception)
rb_jump_tag(payload.exception);
Expand Down