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 785cb3057c95a436c344da2d76ee24b86cb7954b..2c2ae5be99027af909d30a65cb73706a7c0d193a 100644 (file)
@@ -457,6 +457,7 @@ start:
                        for (i = 0; i < numattr; i++)
                                kfree(xattrs[i]);
                        kfree(xattrs);
+                       xattrs = NULL;
                        goto start;
                }
                err = -EIO;