mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SELinux: Leak in error path
@ 2005-03-01  0:32 Alexander Nyberg
  2005-03-01  4:11 ` James Morris
  2005-03-01 15:04 ` Stephen Smalley
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Nyberg @ 2005-03-01  0:32 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, jmorris, sds

There's a leak here in the first error path.

Found by the Coverity tool.

Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>

===== security/selinux/ss/conditional.c 1.3 vs edited =====
--- 1.3/security/selinux/ss/conditional.c	2005-01-05 03:48:22 +01:00
+++ edited/security/selinux/ss/conditional.c	2005-02-23 21:22:25 +01:00
@@ -401,8 +401,10 @@ static int cond_read_node(struct policyd
 		expr->expr_type = le32_to_cpu(buf[0]);
 		expr->bool = le32_to_cpu(buf[1]);
 
-		if (!expr_isvalid(p, expr))
+		if (!expr_isvalid(p, expr)) {
+			kfree(expr);
 			goto err;
+		}
 
 		if (i == 0) {
 			node->expr = expr;



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-01 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01  0:32 [PATCH] SELinux: Leak in error path Alexander Nyberg
2005-03-01  4:11 ` James Morris
2005-03-01 15:04 ` Stephen Smalley

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®