From 3e5d779ecfbce18361d32053f667c7a6f98a28c9 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 7 Feb 2004 16:31:43 +0100 Subject: [PATCH] RPCSEC_GSS: Fix two more memory leaks found by the Stanford checker. --- net/sunrpc/auth_gss/gss_mech_switch.c | 1 + net/sunrpc/auth_gss/gss_pseudoflavors.c | 1 + 2 files changed, 2 insertions(+) diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index b7403e68b3b30..b384cae37052e 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c @@ -70,6 +70,7 @@ gss_mech_register(struct xdr_netobj * mech_type, struct gss_api_ops * ops) } gm->gm_oid.len = mech_type->len; if (!(gm->gm_oid.data = kmalloc(mech_type->len, GFP_KERNEL))) { + kfree(gm); printk("Failed to allocate memory in gss_mech_register"); return -1; } diff --git a/net/sunrpc/auth_gss/gss_pseudoflavors.c b/net/sunrpc/auth_gss/gss_pseudoflavors.c index 9fa3845884738..443b200c96d5a 100644 --- a/net/sunrpc/auth_gss/gss_pseudoflavors.c +++ b/net/sunrpc/auth_gss/gss_pseudoflavors.c @@ -92,6 +92,7 @@ gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech, return 0; err_unlock: + kfree(triple); spin_unlock(®istered_triples_lock); err: return -1; -- 2.53.0