When freeing a superblock returned by ffs_sbget, be sure to also

free the superblock summary information.

Reported by: Peter Holm (pho@)
Tested by: Peter Holm (pho@)
This commit is contained in:
mckusick 2018-03-24 15:36:25 +00:00
parent e9862013d8
commit 44f0dfb9b7
2 changed files with 4 additions and 2 deletions

View File

@ -83,6 +83,7 @@ g_journal_ufs_dirty(struct g_consumer *cp)
fs->fs_clean = 0;
fs->fs_flags |= FS_NEEDSFSCK | FS_UNCLEAN;
error = ffs_sbput(cp, fs, fs->fs_sblockloc, g_use_g_write_data);
g_free(fs->fs_csp);
g_free(fs);
if (error != 0) {
GJ_DEBUG(0, "Cannot mark file system %s as dirty "

View File

@ -103,8 +103,7 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int wh
|| G_LABEL_UFS_CMP(pp, fs, fs_providersize))) {
/* Valid UFS2. */
} else {
g_free(fs);
return;
goto out;
}
G_LABEL_DEBUG(1, "%s file system detected on %s.",
fs->fs_magic == FS_UFS1_MAGIC ? "UFS1" : "UFS2", pp->name);
@ -120,6 +119,8 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int wh
fs->fs_id[1]);
break;
}
out:
g_free(fs->fs_csp);
g_free(fs);
}