Commit 3e5d779e authored by Trond Myklebust's avatar Trond Myklebust

RPCSEC_GSS: Fix two more memory leaks found by the

Stanford checker.
parent 6bb04f23
...@@ -70,6 +70,7 @@ gss_mech_register(struct xdr_netobj * mech_type, struct gss_api_ops * ops) ...@@ -70,6 +70,7 @@ gss_mech_register(struct xdr_netobj * mech_type, struct gss_api_ops * ops)
} }
gm->gm_oid.len = mech_type->len; gm->gm_oid.len = mech_type->len;
if (!(gm->gm_oid.data = kmalloc(mech_type->len, GFP_KERNEL))) { if (!(gm->gm_oid.data = kmalloc(mech_type->len, GFP_KERNEL))) {
kfree(gm);
printk("Failed to allocate memory in gss_mech_register"); printk("Failed to allocate memory in gss_mech_register");
return -1; return -1;
} }
......
...@@ -92,6 +92,7 @@ gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech, ...@@ -92,6 +92,7 @@ gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech,
return 0; return 0;
err_unlock: err_unlock:
kfree(triple);
spin_unlock(&registered_triples_lock); spin_unlock(&registered_triples_lock);
err: err:
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment