diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-30 16:26:30 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-30 16:26:30 +0200 |
commit | 246750ffa1b26335df4e485b4e4d28d83756ac43 (patch) | |
tree | 8c28306f1b66bd89713c9dfe8738097d56056d06 /kernel | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/joern/logfs (diff) | |
parent | CRED: Fix memory leak in error handling (diff) | |
download | linux-246750ffa1b26335df4e485b4e4d28d83756ac43.tar.xz linux-246750ffa1b26335df4e485b4e4d28d83756ac43.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
CRED: Fix memory leak in error handling
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cred.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/cred.c b/kernel/cred.c index 1ed8ca18790c..1b1129d0cce8 100644 --- a/kernel/cred.c +++ b/kernel/cred.c @@ -364,7 +364,7 @@ struct cred *prepare_usermodehelper_creds(void) new = kmem_cache_alloc(cred_jar, GFP_ATOMIC); if (!new) - return NULL; + goto free_tgcred; kdebug("prepare_usermodehelper_creds() alloc %p", new); @@ -397,6 +397,10 @@ struct cred *prepare_usermodehelper_creds(void) error: put_cred(new); +free_tgcred: +#ifdef CONFIG_KEYS + kfree(tgcred); +#endif return NULL; } |