diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 177f81608cfbaa1fd983b2b22497a74c58f96b67..0d1e8fb83b930ee4e9e472d07e2f265875389b02 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -53,6 +53,10 @@ struct auth_domain *unix_domain_find(char *name) return NULL; kref_init(&new->h.ref); new->h.name = kstrdup(name, GFP_KERNEL); + if (new->h.name == NULL) { + kfree(new); + return NULL; + } new->h.flavour = &svcauth_unix; new->addr_changes = 0; rv = auth_domain_lookup(name, &new->h);