public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 06/14] libmount, col: remove redundant null checks [smatch scan]
Date: Mon,  8 Apr 2013 20:32:51 +0100	[thread overview]
Message-ID: <1365449579-13238-7-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1365449579-13238-1-git-send-email-kerolasa@iki.fi>

libmount/src/context_umount.c:174 mnt_context_find_umount_fs() info: redundant null check on loopdev calling free()
libmount/src/context_umount.c:179 mnt_context_find_umount_fs() info: redundant null check on loopdev calling free()
text-utils/col.c:406 flush_lines() info: redundant null check on l->l_line calling free()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 libmount/src/context_umount.c | 6 ++----
 text-utils/col.c              | 3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 96ae87a..b948459 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -170,13 +170,11 @@ try_loopdev:
 	}
 
 	*pfs = fs;
-	if (loopdev)
-		free(loopdev);
+	free(loopdev);
 
 	return fs ? 0 : 1;
 err:
-	if (loopdev)
-		free(loopdev);
+	free(loopdev);
 	return rc;
 }
 
diff --git a/text-utils/col.c b/text-utils/col.c
index 474b33f..9aa6a41 100644
--- a/text-utils/col.c
+++ b/text-utils/col.c
@@ -402,8 +402,7 @@ void flush_lines(int nflush)
 			flush_line(l);
 		}
 		nblank_lines++;
-		if (l->l_line)
-			free((void *)l->l_line);
+		free((void *)l->l_line);
 		free_line(l);
 	}
 	if (lines)
-- 
1.8.2.1


  parent reply	other threads:[~2013-04-08 19:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 19:32 [PATCH 00/14] [pull] smatch scan, and manual tooling Sami Kerola
2013-04-08 19:32 ` [PATCH 01/14] setarch: clean up usage() Sami Kerola
2013-04-08 19:32 ` [PATCH 02/14] bash-completion: setarch: use correct list for architectures Sami Kerola
2013-04-08 19:32 ` [PATCH 03/14] bash-completion: swapon: add options and fix argument Sami Kerola
2013-04-08 19:32 ` [PATCH 04/14] various: fix variable and function declarations [smatch scan] Sami Kerola
2013-04-08 19:32 ` [PATCH 05/14] various: fix shadow " Sami Kerola
2013-04-08 19:32 ` Sami Kerola [this message]
2013-04-08 19:32 ` [PATCH 07/14] libblkid: number of functions should not be declared extern " Sami Kerola
2013-04-08 19:32 ` [PATCH 08/14] tools: add checks to manual page test script Sami Kerola
2013-04-08 19:32 ` [PATCH 09/14] docs: mount.8: make propagation flags adjustable [checkmans.sh] Sami Kerola
2013-04-08 19:32 ` [PATCH 10/14] docs: col.1: fix manual page name section [checkmans.sh] Sami Kerola
2013-04-08 19:32 ` [PATCH 11/14] docs: remove repeated words [checkmans.sh] Sami Kerola
2013-04-08 19:32 ` [PATCH 12/14] tools: make checkmans.sh to find missing manuals Sami Kerola
2013-04-08 19:32 ` [PATCH 13/14] docs: add mkfs.cramfs manual page Sami Kerola
2013-04-08 19:32 ` [PATCH 14/14] docs: add fsck.cramfs " Sami Kerola
2013-04-09 10:30 ` [PATCH 00/14] [pull] smatch scan, and manual tooling Karel Zak

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=1365449579-13238-7-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@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