ceph: fix potential double free
authorAlan Cox <alan@linux.intel.com>
Fri, 20 Jul 2012 13:18:36 +0000 (08:18 -0500)
committerSage Weil <sage@inktank.com>
Tue, 31 Jul 2012 01:15:35 +0000 (18:15 -0700)
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>
fs/ceph/xattr.c

index 785cb30..2c2ae5b 100644 (file)
@@ -457,6 +457,7 @@ start:
                        for (i = 0; i < numattr; i++)
                                kfree(xattrs[i]);
                        kfree(xattrs);
+                       xattrs = NULL;
                        goto start;
                }
                err = -EIO;