SELinux Security Module development
 help / color / mirror / Atom feed
From: "Christian Göttsche" <cgzones@googlemail.com>
To: selinux@vger.kernel.org
Subject: [PATCH 10/25] libselinux: exclude_non_seclabel_mounts(): drop unused variable
Date: Mon,  3 May 2021 19:53:35 +0200	[thread overview]
Message-ID: <20210503175350.55954-11-cgzones@googlemail.com> (raw)
In-Reply-To: <20210503175350.55954-1-cgzones@googlemail.com>

The variable `num` is never read from.

Found by clang-analyer.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libselinux/src/selinux_restorecon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c
index 249c361f..6fb9e1ff 100644
--- a/libselinux/src/selinux_restorecon.c
+++ b/libselinux/src/selinux_restorecon.c
@@ -230,7 +230,6 @@ static int exclude_non_seclabel_mounts(void)
 	struct utsname uts;
 	FILE *fp;
 	size_t len;
-	ssize_t num;
 	int index = 0, found = 0, nfile = 0;
 	char *mount_info[4];
 	char *buf = NULL, *item;
@@ -245,7 +244,7 @@ static int exclude_non_seclabel_mounts(void)
 	if (!fp)
 		return 0;
 
-	while ((num = getline(&buf, &len, fp)) != -1) {
+	while (getline(&buf, &len, fp) != -1) {
 		found = 0;
 		index = 0;
 		item = strtok(buf, " ");
-- 
2.31.1


  parent reply	other threads:[~2021-05-03 17:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 17:53 [PATCH 00/25] libselinux: misc compiler and static analyzer findings Christian Göttsche
2021-05-03 17:53 ` [PATCH 01/25] libselinux: sidtab_hash(): do not discard const qualifier Christian Göttsche
2021-05-03 17:53 ` [PATCH 02/25] libselinux: selinux_file_context_cmp(): " Christian Göttsche
2021-05-03 17:53 ` [PATCH 03/25] libselinux: label_common(): " Christian Göttsche
2021-05-03 17:53 ` [PATCH 04/25] libselinux: Sha1Finalise(): " Christian Göttsche
2021-05-03 17:53 ` [PATCH 05/25] libselinux: sefcontext_compile: mark local variable static Christian Göttsche
2021-05-03 17:53 ` [PATCH 06/25] libselinux: avcstat: use standard length modifier for unsigned long long Christian Göttsche
2021-05-03 17:53 ` [PATCH 07/25] libselinux: selinux_restorecon: mark local variable static Christian Göttsche
2021-05-03 17:53 ` [PATCH 08/25] libselinux: selabel_get_digests_all_partial_matches: free memory after FTS_D block Christian Göttsche
2021-05-03 17:53 ` [PATCH 09/25] libselinux: getconlist: free memory on multiple level arguments Christian Göttsche
2021-05-03 17:53 ` Christian Göttsche [this message]
2021-05-03 17:53 ` [PATCH 11/25] libselinux: context_new(): drop dead assignment Christian Göttsche
2021-05-03 17:53 ` [PATCH 12/25] libselinux: label_x::init(): " Christian Göttsche
2021-05-03 17:53 ` [PATCH 13/25] libselinux: label_media::init(): " Christian Göttsche
2021-05-03 17:53 ` [PATCH 14/25] libselinux: setexecfilecon(): " Christian Göttsche
2021-05-03 17:53 ` [PATCH 15/25] libselinux: getdefaultcon: free memory on multiple same arguments Christian Göttsche
2021-05-03 17:53 ` [PATCH 16/25] libselinux: store_stem(): do not free possible non-heap object Christian Göttsche
2021-05-03 17:53 ` [PATCH 17/25] libselinux: matchmediacon(): close file on error Christian Göttsche
2021-05-03 17:53 ` [PATCH 18/25] libselinux: init_selinux_config(): free resources " Christian Göttsche
2021-05-03 17:53 ` [PATCH 19/25] libselinux: label_file::init(): do not pass NULL to strdup Christian Göttsche
2021-05-03 17:53 ` [PATCH 20/25] libselinux: matchpathcon: free memory on realloc failure Christian Göttsche
2021-05-03 17:53 ` [PATCH 21/25] libselinux: label_db::db_init(): open file with CLOEXEC mode Christian Göttsche
2021-05-03 17:53 ` [PATCH 22/25] libselinux: drop redundant casts to the same type Christian Göttsche
2021-05-03 17:53 ` [PATCH 23/25] libselinux: sidtab_sid_stats(): unify parameter name Christian Göttsche
2021-05-03 17:53 ` [PATCH 24/25] libselinux: regex: unify parameter names Christian Göttsche
2021-05-03 17:53 ` [PATCH 25/25] libselinux: label_file.c: fix indent Christian Göttsche
2021-05-18 18:37 ` [PATCH 00/25] libselinux: misc compiler and static analyzer findings Petr Lautrbach

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=20210503175350.55954-11-cgzones@googlemail.com \
    --to=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.org \
    /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