summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-05-14 16:11:48 -0700
committerAl Viro <viro@zeniv.linux.org.uk>2008-05-17 03:30:22 -0400
commitfcaf1eb8685a00a99259e138e403841e984385b0 (patch)
tree01663c2345f200014f028b7cee2d3270e3100601
parent6ee650467d5bf972d10441e99688e9b48171f99c (diff)
downloadlinux-fcaf1eb8685a00a99259e138e403841e984385b0.tar.gz
[patch 1/1] audit_send_reply(): fix error-path memory leak
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=10663

Reporter: Daniel Marjamki <danielm77@spray.se>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--kernel/audit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index b7d3709cc452..e8692a5748c2 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -572,16 +572,17 @@ void audit_send_reply(int pid, int seq, int type, int done, int multi,
 
 	skb = audit_make_reply(pid, seq, type, done, multi, payload, size);
 	if (!skb)
-		return;
+		goto out;
 
 	reply->pid = pid;
 	reply->skb = skb;
 
 	tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply");
-	if (IS_ERR(tsk)) {
-		kfree(reply);
-		kfree_skb(skb);
-	}
+	if (!IS_ERR(tsk))
+		return;
+	kfree_skb(skb);
+out:
+	kfree(reply);
 }
 
 /*