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:
parent
2ba59743f2
commit
a95ac78b9c
@ -460,6 +460,7 @@ bmap_truncate_mapping(struct nandfs_node *node, nandfs_lbn_t lastblk,
|
|||||||
error = bmap_truncate_indirect(node, level, &left,
|
error = bmap_truncate_indirect(node, level, &left,
|
||||||
&cleaned, ap, f, copy);
|
&cleaned, ap, f, copy);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
free(copy, M_NANDFSTEMP);
|
||||||
nandfs_error("%s: error %d when truncate "
|
nandfs_error("%s: error %d when truncate "
|
||||||
"at level %d\n", __func__, error, level);
|
"at level %d\n", __func__, error, level);
|
||||||
return (error);
|
return (error);
|
||||||
|
Loading…
Reference in New Issue
Block a user