bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] [PATCH] build: remove unnecessary if-before-free


From: Jim Meyering
Subject: [bug-patch] [PATCH] build: remove unnecessary if-before-free
Date: Wed, 01 Aug 2012 14:35:28 +0200

This probably counts as trivial, but with an impending release
I'll wait for an ACK before pushing it.

>From 7ce9bbfdb5d671702e3eabc921fb99b195367e91 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 1 Aug 2012 14:33:39 +0200
Subject: [PATCH] build: remove unnecessary if-before-free

* src/util.c (update_sha1): Remove unnecessary if-before-free,
to avoid "make syntax-check" failure.
---
 src/util.c | 3 +--
 1 file changed, 1 insertion(+), 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;
 }

--
1.7.12.rc1.10.g97c7934



reply via email to

[Prev in Thread] Current Thread [Next in Thread]