Skip to content

Commit

Permalink
ceph: fix potential double free
Browse files Browse the repository at this point in the history
We re-run the loop but we don't re-set the attrs pointer back to NULL.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Reviewed-by: Alex Elder <elder@inktank.com>
  • Loading branch information
Alan Cox authored and Sage Weil committed Jul 31, 2012
1 parent 85effe1 commit 21ec6ff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ static int __build_xattrs(struct inode *inode)
for (i = 0; i < numattr; i++)
kfree(xattrs[i]);
kfree(xattrs);
xattrs = NULL;
goto start;
}
err = -EIO;
Expand Down

0 comments on commit 21ec6ff

Please sign in to comment.