From: Stefan Weil <sw@weilnetz.de>
To: qemu-trivial@nongnu.org
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] sparc-dis: Remove redundant NULL check
Date: Mon, 3 Sep 2012 22:23:23 +0200 [thread overview]
Message-ID: <1346703803-22003-1-git-send-email-sw@weilnetz.de> (raw)
Report from smatch:
sparc-dis.c:2664 build_hash_table(14) info:
redundant null check on hash_buf calling free()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
Coding style was not fixed.
- sw
sparc-dis.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sparc-dis.c b/sparc-dis.c
index cdd337a..ef28835 100644
--- a/sparc-dis.c
+++ b/sparc-dis.c
@@ -2660,8 +2660,7 @@ build_hash_table (const sparc_opcode **opcode_table,
memset (hash_table, 0, HASH_SIZE * sizeof (hash_table[0]));
memset (hash_count, 0, HASH_SIZE * sizeof (hash_count[0]));
- if (hash_buf != NULL)
- free (hash_buf);
+ free (hash_buf);
hash_buf = malloc (sizeof (* hash_buf) * num_opcodes);
for (i = num_opcodes - 1; i >= 0; --i)
{
--
1.7.10
next reply other threads:[~2012-09-03 20:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 20:23 Stefan Weil [this message]
2012-09-05 9:34 ` [Qemu-devel] [Qemu-trivial] [PATCH] sparc-dis: Remove redundant NULL check Stefan Hajnoczi
2012-09-05 15:51 ` [Qemu-devel] " Andreas Färber
2012-09-05 16:55 ` Stefan Hajnoczi
2012-09-05 17:15 ` Stefan Weil
2012-09-05 17:45 ` Stefan Weil
2012-09-20 17:03 ` Stefan Weil
2012-09-21 8:06 ` Andreas Färber
2012-09-05 18:13 ` Stefan Weil
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=1346703803-22003-1-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.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;
as well as URLs for NNTP newsgroup(s).