summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apply.c b/apply.c
index ea92a2455d..466f880d73 100644
--- a/apply.c
+++ b/apply.c
@@ -1782,7 +1782,7 @@ static int parse_single_patch(struct apply_state *state,
struct fragment *fragment;
int len;
- fragment = xcalloc(1, sizeof(*fragment));
+ CALLOC_ARRAY(fragment, 1);
fragment->linenr = state->linenr;
len = parse_fragment(state, line, size, patch, fragment);
if (len <= 0) {
@@ -1960,7 +1960,7 @@ static struct fragment *parse_binary_hunk(struct apply_state *state,
size -= llen;
}
- frag = xcalloc(1, sizeof(*frag));
+ CALLOC_ARRAY(frag, 1);
frag->patch = inflate_it(data, hunk_size, origlen);
frag->free_patch = 1;
if (!frag->patch)
@@ -4682,7 +4682,7 @@ static int apply_patch(struct apply_state *state,
struct patch *patch;
int nr;
- patch = xcalloc(1, sizeof(*patch));
+ CALLOC_ARRAY(patch, 1);
patch->inaccurate_eof = !!(options & APPLY_OPT_INACCURATE_EOF);
patch->recount = !!(options & APPLY_OPT_RECOUNT);
nr = parse_chunk(state, buf.buf + offset, buf.len - offset, patch);