netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul Moore" <paul.moore@hp.com>
To: netdev@vger.kernel.org, selinux@tycho.nsa.gov
Cc: Paul Moore <paul.moore@hp.com>
Subject: [PATCH 1/2] SELinux: remove redundant pointer checks before calling kfree()
Date: Wed, 01 Aug 2007 11:12:58 -0400	[thread overview]
Message-ID: <20070801151554.725968439@hp.com> (raw)
In-Reply-To: 20070801151257.475951538@hp.com

[-- Attachment #1: selinux-kfree_check --]
[-- Type: text/plain, Size: 678 bytes --]

We don't need to check for NULL pointers before calling kfree().

Signed-off-by: Paul Moore <paul.moore@hp.com>
---
 security/selinux/hooks.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6_secctx-leaks/security/selinux/hooks.c
===================================================================
--- linux-2.6_secctx-leaks.orig/security/selinux/hooks.c
+++ linux-2.6_secctx-leaks/security/selinux/hooks.c
@@ -4658,8 +4658,7 @@ static int selinux_secid_to_secctx(u32 s
 
 static void selinux_release_secctx(char *secdata, u32 seclen)
 {
-	if (secdata)
-		kfree(secdata);
+	kfree(secdata);
 }
 
 #ifdef CONFIG_KEYS

-- 
paul moore
linux security @ hp

  reply	other threads:[~2007-08-01 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01 15:12 [PATCH 0/2] Small memory-leak patchset Paul Moore
2007-08-01 15:12 ` Paul Moore [this message]
2007-08-01 15:12 ` [PATCH 2/2] NET: fix memory leaks from security_secid_to_secctx() Paul Moore
2007-08-02  0:05   ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070801151554.725968439@hp.com \
    --to=paul.moore@hp.com \
    --cc=netdev@vger.kernel.org \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).