History

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

Linus Torvalds committed 16 years ago

Commit 246750f2 parents 4660d3d 570b8fb1 file · +5 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/cred.c+5−1
@@ -364,7 +364,7 @@ struct cred *prepare_usermodehelper_creds(void) · 363 unmodified lines
364 364
365 new = kmem_cache_alloc(cred_jar, GFP_ATOMIC);365 new = kmem_cache_alloc(cred_jar, GFP_ATOMIC);
366 if (!new)366 if (!new)
367 return NULL;367 goto free_tgcred;
368 368
369 kdebug("prepare_usermodehelper_creds() alloc %p", new);369 kdebug("prepare_usermodehelper_creds() alloc %p", new);
370 370
@@ -397,6 +397,10 @@ struct cred *prepare_usermodehelper_creds(void) · 26 unmodified lines
397 397
398error:398error:
399 put_cred(new);399 put_cred(new);
400free_tgcred:
401#ifdef CONFIG_KEYS
402 kfree(tgcred);
403#endif
400 return NULL;404 return NULL;
401}405}
402 406