Re: [PATCH 1/1] cred: fix memory leak

From: Jiri Slaby
Date: Wed Jan 06 2010 - 12:31:44 EST


On 01/06/2010 06:25 PM, Serge E. Hallyn wrote:
> Quoting Jiri Slaby (jslaby@xxxxxxx):
>> Stanse found a memory leak in prepare_exec_creds. tgcred is not
>> freed/assigned on all paths. Fix that.
>>
>> I.e. unifdef tgcred and add kfree(tgcred); as it is initialized to
>> NULL already.
>
> Does this compile with CONFIG_KEYS=n, , though?

Yes and I guess it's due to no dereference of the pointer.

> Should this patch add one?

Hmm, I don't think so. The patch is ugly in the light of not having the
struct defined. I should come up with something where the CONFIG_KEYS is
left there.

thanks,
--
js
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/