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:
kan 2015-02-28 22:24:45 +00:00
parent 2ba59743f2
commit a95ac78b9c

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