aboutsummaryrefslogtreecommitdiff
path: root/ubifs-utils
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2018-10-18 16:36:55 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2018-11-01 12:39:47 +0100
commita0de1fe7c1bfca533e189b36c4cd3792d15821df (patch)
tree5569c60559630254d9f3e2f45fef80cff9427380 /ubifs-utils
parent5b63183c901a2d8c052ac5be44486eb090165a19 (diff)
mkfs.ubifs: Free all index entry names
...and make valgrind memcheck happy Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils')
-rw-r--r--ubifs-utils/mkfs.ubifs/mkfs.ubifs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
index 8aba668..66ca061 100644
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
@@ -1253,7 +1253,7 @@ static int add_xattr(struct ubifs_ino_node *host_ino, struct stat *st, ino_t inu
if (data_len)
memcpy(&ino->data, data, data_len);
- ret = add_node(&nkey, nm.name, nm.len, ino, UBIFS_INO_NODE_SZ + data_len) ;
+ ret = add_node(&nkey, NULL, 0, ino, UBIFS_INO_NODE_SZ + data_len);
out:
free(xent);
@@ -1447,7 +1447,7 @@ static int set_fscrypt_context(struct ubifs_ino_node *host_ino, ino_t inum,
struct fscrypt_context *fctx)
{
return add_xattr(host_ino, host_st, inum,
- UBIFS_XATTR_NAME_ENCRYPTION_CONTEXT,
+ xstrdup(UBIFS_XATTR_NAME_ENCRYPTION_CONTEXT),
fctx, sizeof(*fctx));
}
@@ -2470,8 +2470,10 @@ static int write_index(void)
}
/* Free stuff */
- for (i = 0; i < idx_cnt; i++)
+ for (i = 0; i < idx_cnt; i++) {
+ free(idx_ptr[i]->name);
free(idx_ptr[i]);
+ }
free(idx_ptr);
free(idx);