summaryrefslogtreecommitdiff
path: root/lib/sqfs/write_export_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/write_export_table.c')
-rw-r--r--lib/sqfs/write_export_table.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqfs/write_export_table.c b/lib/sqfs/write_export_table.c
index a0d81eb..8794609 100644
--- a/lib/sqfs/write_export_table.c
+++ b/lib/sqfs/write_export_table.c
@@ -10,10 +10,11 @@ int write_export_table(int outfd, fstree_t *fs, sqfs_super_t *super,
compressor_t *cmp)
{
uint64_t *table, start;
- size_t i;
+ size_t i, size;
int ret;
- table = malloc(sizeof(uint64_t) * (fs->inode_tbl_size - 1));
+ size = sizeof(uint64_t) * (fs->inode_tbl_size - 1);
+ table = malloc(size);
if (table == NULL) {
perror("Allocating NFS export table");
@@ -28,8 +29,7 @@ int write_export_table(int outfd, fstree_t *fs, sqfs_super_t *super,
}
}
- ret = sqfs_write_table(outfd, super, table, sizeof(table[0]),
- fs->inode_tbl_size - 1, &start, cmp);
+ ret = sqfs_write_table(outfd, super, cmp, table, size, &start);
super->export_table_start = start;
super->flags |= SQFS_FLAG_EXPORTABLE;