summaryrefslogtreecommitdiff
path: root/cmds-restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-restore.c')
-rw-r--r--cmds-restore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds-restore.c b/cmds-restore.c
index dc6c0274..e2bcbf92 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -251,7 +251,7 @@ static int copy_one_inline(int fd, struct btrfs_path *path, u64 pos)
}
ram_size = btrfs_file_extent_ram_bytes(leaf, fi);
- outbuf = malloc(ram_size);
+ outbuf = calloc(1, ram_size);
if (!outbuf) {
fprintf(stderr, "No memory\n");
return -ENOMEM;
@@ -320,7 +320,7 @@ static int copy_one_extent(struct btrfs_root *root, int fd,
}
if (compress != BTRFS_COMPRESS_NONE) {
- outbuf = malloc(ram_size);
+ outbuf = calloc(1, ram_size);
if (!outbuf) {
fprintf(stderr, "No memory\n");
free(inbuf);