1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Do not leak 'copy' buffer if bmap_truncate_indirect fails.

Reported by: Brainy Code Scanner, by Maxime Villard.
MFC after: 2 weeks
This commit is contained in:
Alexander Kabaev 2015-02-28 22:24:45 +00:00
parent c14bdeb07e
commit 0fd841369a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279412

View File

@ -460,6 +460,7 @@ bmap_truncate_mapping(struct nandfs_node *node, nandfs_lbn_t lastblk,
error = bmap_truncate_indirect(node, level, &left,
&cleaned, ap, f, copy);
if (error) {
free(copy, M_NANDFSTEMP);
nandfs_error("%s: error %d when truncate "
"at level %d\n", __func__, error, level);
return (error);