Skip to content

Commit d253612

Browse files
Merge pull request #583 from libgit2/xmalloc
ext: Use `xmalloc` instead of `malloc`
2 parents bbb2937 + c78a9ee commit d253612

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/rugged/rugged_repo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ void rugged_parse_checkout_options(git_checkout_options *opts, VALUE rb_options)
19451945

19461946
rb_value = rb_hash_aref(rb_options, CSTR2SYM("progress"));
19471947
if (!NIL_P(rb_value)) {
1948-
struct rugged_cb_payload *payload = malloc(sizeof(struct rugged_cb_payload));
1948+
struct rugged_cb_payload *payload = xmalloc(sizeof(struct rugged_cb_payload));
19491949
payload->rb_data = rb_value;
19501950
payload->exception = 0;
19511951

@@ -1955,7 +1955,7 @@ void rugged_parse_checkout_options(git_checkout_options *opts, VALUE rb_options)
19551955

19561956
rb_value = rb_hash_aref(rb_options, CSTR2SYM("notify"));
19571957
if (!NIL_P(rb_value)) {
1958-
struct rugged_cb_payload *payload = malloc(sizeof(struct rugged_cb_payload));
1958+
struct rugged_cb_payload *payload = xmalloc(sizeof(struct rugged_cb_payload));
19591959
payload->rb_data = rb_value;
19601960
payload->exception = 0;
19611961

0 commit comments

Comments
 (0)