summaryrefslogtreecommitdiff
path: root/lib/fstree/fstree_from_dir.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-23 01:33:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-23 02:09:51 +0200
commit7c028e224978e1d5a4f207cc42b9eb58d81897dd (patch)
treed7165e3b9d1a7041cd79712526ad472c21135bdc /lib/fstree/fstree_from_dir.c
parent0a5383ccdf8e87d2259d02a9ff44420b3bc3f58d (diff)
Some simple search/replace cases for allocation
This commit exchanges some malloc(x + y * z) patterns that can be found with a simple git grep and are obvious for the new wrappers. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/fstree_from_dir.c')
-rw-r--r--lib/fstree/fstree_from_dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c
index ae8cac9..9aab5df 100644
--- a/lib/fstree/fstree_from_dir.c
+++ b/lib/fstree/fstree_from_dir.c
@@ -90,7 +90,7 @@ static int populate_xattr(fstree_t *fs, tree_node_t *node)
goto fail;
if (vallen > 0) {
- value = calloc(1, vallen + 1);
+ value = alloc_string(vallen);
if (value == NULL) {
perror("xattr value buffer");
goto fail;
@@ -163,7 +163,7 @@ static int populate_dir(fstree_t *fs, tree_node_t *root, dev_t devstart,
continue;
if (S_ISLNK(sb.st_mode)) {
- extra = calloc(1, sb.st_size + 1);
+ extra = alloc_string(sb.st_size);
if (extra == NULL)
goto fail_rdlink;