Commit fcaf1eb8685a00a99259e138e403841e984385b0

Authored by Andrew Morton
Committed by Al Viro
1 parent 6ee650467d

[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>

Showing 1 changed file with 6 additions and 5 deletions Side-by-side Diff

... ... @@ -572,16 +572,17 @@
572 572  
573 573 skb = audit_make_reply(pid, seq, type, done, multi, payload, size);
574 574 if (!skb)
575   - return;
  575 + goto out;
576 576  
577 577 reply->pid = pid;
578 578 reply->skb = skb;
579 579  
580 580 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);
585 586 }
586 587  
587 588 /*