diff options
Diffstat (limited to 'builtin/apply.c')
-rw-r--r-- | builtin/apply.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/apply.c b/builtin/apply.c index 5fd099ed40..9f8f5bac07 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -2867,9 +2867,7 @@ static int apply_binary_fragment(struct image *img, struct patch *patch) case BINARY_LITERAL_DEFLATED: clear_image(img); img->len = fragment->size; - img->buf = xmalloc(img->len+1); - memcpy(img->buf, fragment->patch, img->len); - img->buf[img->len] = '\0'; + img->buf = xmemdupz(fragment->patch, img->len); return 0; } return -1; |