summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-08-01 14:33:39 +0200
committerJim Meyering <meyering@redhat.com>2012-08-01 15:05:42 +0200
commit46e58be9cc872aba55dbe89eef9261675722c323 (patch)
tree15804bacf2b199c36920c0881ffe1cdd1f01274c
parent1118f832efe3920ffe9b57cdd8c0af1ac9a76993 (diff)
downloadpatch-46e58be9cc872aba55dbe89eef9261675722c323.tar.gz
build: remove unnecessary if-before-free
* src/util.c (update_sha1): Remove unnecessary if-before-free, to avoid "make syntax-check" failure.
-rw-r--r--src/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index d392ffe..9177fda 100644
--- a/src/util.c
+++ b/src/util.c
@@ -152,8 +152,7 @@ update_sha1 (struct stat const *st, char const *sha1)
if (! p)
p = __insert_file_id (st, UNKNOWN);
else
- if (p->sha1)
- free (p->sha1);
+ free (p->sha1);
p->sha1 = sha1 ? xstrdup (sha1) : 0;
}