X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;ds=sidebyside;f=security%2Fselinux%2Fhooks.c;h=6d0b1ccb5b99f1aff76d94a256068de1f4682a7b;hb=ece13879e74313e62109e0755dd3d4f172df89e2;hp=254b7983657de8735ce5a7ba92e62c3756fb590c;hpb=b08dc3eba0c34027010caeda258f495074ae3a54;p=safe%2Fjmp%2Flinux-2.6 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 254b798..6d0b1cc 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1285,6 +1285,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX, context, len); if (rc == -ERANGE) { + kfree(context); + /* Need a larger buffer. Query for the right size. */ rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX, NULL, 0); @@ -1292,7 +1294,6 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent dput(dentry); goto out_unlock; } - kfree(context); len = rc; context = kmalloc(len+1, GFP_NOFS); if (!context) {