SUNRPC: Fix a memory leak in the auth credcache code
[powerpc.git] / net / sunrpc / auth_unix.c
index 4e7733a..5622783 100644 (file)
@@ -50,7 +50,7 @@ static void
 unx_destroy(struct rpc_auth *auth)
 {
        dprintk("RPC:       destroying UNIX authenticator %p\n", auth);
-       rpcauth_free_credcache(auth);
+       rpcauth_clear_credcache(auth->au_credcache);
 }
 
 /*
@@ -92,6 +92,7 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
                if (i < NFS_NGROUPS)
                  cred->uc_gids[i] = NOGROUP;
        }
+       cred->uc_base.cr_auth = &unix_auth;
        cred->uc_base.cr_ops = &unix_credops;
 
        return (struct rpc_cred *) cred;