diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index d22ebb7..57aab94 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -847,8 +847,10 @@ cleanup:
 	if (ce)
 		mb_cache_entry_release(ce);
 	brelse(new_bh);
-	if (!(bs->bh && s->base == bs->bh->b_data))
+	if (!(bs->bh && s->base == bs->bh->b_data)) {
 		kfree(s->base);
+		s->base = NULL;
+	}
 
 	return error;
 
