* [PATCH] kmod: Release sub_info on cred allocation failure.
@ 2009-05-26 8:11 David Howells
0 siblings, 0 replies; only message in thread
From: David Howells @ 2009-05-26 8:11 UTC (permalink / raw)
To: torvalds, akpm
Cc: linux-security-module, linux-kernel, Tetsuo Handa, David Howells
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
call_usermodehelper_setup() forgot to kfree(sub_info)
when prepare_usermodehelper_creds() failed.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
---
kernel/kmod.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/kernel/kmod.c b/kernel/kmod.c
index b750675..7e95bed 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -370,8 +370,10 @@ struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
sub_info->argv = argv;
sub_info->envp = envp;
sub_info->cred = prepare_usermodehelper_creds();
- if (!sub_info->cred)
+ if (!sub_info->cred) {
+ kfree(sub_info);
return NULL;
+ }
out:
return sub_info;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-26 8:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26 8:11 [PATCH] kmod: Release sub_info on cred allocation failure David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®