projects
/
platform
/
upstream
/
btrfs-progs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
btrfs-progs: use calloc instead of malloc+memset
[platform/upstream/btrfs-progs.git]
/
btrfs-image.c
diff --git
a/btrfs-image.c
b/btrfs-image.c
index
82eed05
..
20396ef
100644
(file)
--- a/
btrfs-image.c
+++ b/
btrfs-image.c
@@
-1505,10
+1505,9
@@
static struct extent_buffer *alloc_dummy_eb(u64 bytenr, u32 size)
{
struct extent_buffer *eb;
- eb =
malloc(
sizeof(struct extent_buffer) + size);
+ eb =
calloc(1,
sizeof(struct extent_buffer) + size);
if (!eb)
return NULL;
- memset(eb, 0, sizeof(struct extent_buffer) + size);
eb->start = bytenr;
eb->len = size;