Fix several memleaks
parent
57d1067a22
commit
b1583bdce6
|
@ -1261,6 +1261,7 @@ static ntfs_inode *__ntfs_create(ntfs_inode *dir_ni,
|
|||
ntfs_log_error("Failed to add INDEX_ROOT attribute.\n");
|
||||
goto err_out;
|
||||
}
|
||||
free(ir);
|
||||
} else {
|
||||
INTX_FILE *data;
|
||||
int data_len;
|
||||
|
@ -1312,6 +1313,7 @@ static ntfs_inode *__ntfs_create(ntfs_inode *dir_ni,
|
|||
if (ntfs_attr_add(ni, AT_DATA, AT_UNNAMED, 0, (u8*)data,
|
||||
data_len)) {
|
||||
err = errno;
|
||||
free(data);
|
||||
ntfs_log_error("Failed to add DATA attribute.\n");
|
||||
goto err_out;
|
||||
}
|
||||
|
|
|
@ -220,6 +220,7 @@ mft_has_no_attr_list:
|
|||
std_info = ntfs_attr_readall(vol->mft_ni, AT_STANDARD_INFORMATION,
|
||||
AT_UNNAMED, 0, NULL);
|
||||
vol->mft_ni->flags = std_info->file_attributes;
|
||||
free(std_info);
|
||||
|
||||
/* We now have a fully setup ntfs inode for $MFT in vol->mft_ni. */
|
||||
|
||||
|
|
|
@ -1800,6 +1800,7 @@ int main(int argc, char *argv[])
|
|||
/* Mount volume. */
|
||||
if (ntfs_fuse_mount(opts.device)) {
|
||||
ntfs_fuse_destroy();
|
||||
free(parsed_options);
|
||||
return 4;
|
||||
}
|
||||
/* Create filesystem. */
|
||||
|
@ -1814,12 +1815,12 @@ int main(int argc, char *argv[])
|
|||
#else
|
||||
ffd = fuse_mount(opts.mnt_point, parsed_options);
|
||||
#endif
|
||||
free(parsed_options);
|
||||
if (ffd == -1) {
|
||||
ntfs_log_error("fuse_mount failed.\n");
|
||||
ntfs_fuse_destroy();
|
||||
return 5;
|
||||
}
|
||||
free(parsed_options);
|
||||
#if defined(FUSE_VERSION) && (FUSE_VERSION >= 25)
|
||||
fh = (struct fuse *)1; /* Cast anything except NULL to handle errors. */
|
||||
margs = (struct fuse_args)FUSE_ARGS_INIT(0, NULL);
|
||||
|
|
Loading…
Reference in New Issue