Skip to content

Commit fcaf1eb

Browse files
akpm00Al Viro
authored andcommitted
[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>
1 parent 6ee6504 commit fcaf1eb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎kernel/audit.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,16 +572,17 @@ void audit_send_reply(int pid, int seq, int type, int done, int multi,
572572

573573
skb = audit_make_reply(pid, seq, type, done, multi, payload, size);
574574
if (!skb)
575-
return;
575+
goto out;
576576

577577
reply->pid = pid;
578578
reply->skb = skb;
579579

580580
tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply");
581-
if (IS_ERR(tsk)) {
582-
kfree(reply);
583-
kfree_skb(skb);
584-
}
581+
if (!IS_ERR(tsk))
582+
return;
583+
kfree_skb(skb);
584+
out:
585+
kfree(reply);
585586
}
586587

587588
/*

0 commit comments

Comments
 (0)