]> git.hungrycats.org Git - linux/commitdiff
RPCSEC_GSS: Fix two more memory leaks found by the
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Sat, 7 Feb 2004 15:31:43 +0000 (16:31 +0100)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Sat, 7 Feb 2004 15:31:43 +0000 (16:31 +0100)
Stanford checker.

net/sunrpc/auth_gss/gss_mech_switch.c
net/sunrpc/auth_gss/gss_pseudoflavors.c

index b7403e68b3b30e056860f447bf0e367ee63ca067..b384cae37052e573185427d4cbdf39769b33bb1b 100644 (file)
@@ -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;
        }
index 9fa3845884738682c5031002b2461c0beda9298a..443b200c96d5acb16a7a63b58deeb466ab17418a 100644 (file)
@@ -92,6 +92,7 @@ gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech,
        return 0;
 
 err_unlock:
+       kfree(triple);
        spin_unlock(&registered_triples_lock);
 err:
        return -1;