Fix several memleaks

edge.strict_endians
yura 2006-10-27 14:15:32 +00:00
parent 57d1067a22
commit b1583bdce6
3 changed files with 5 additions and 1 deletions

View File

@ -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;
}

View File

@ -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. */

View File

@ -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);