summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2017-06-15 23:15:46 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-06-16 12:44:03 -0700
commit6a83d902073803c4141e02c53decf8c03e35da27 (patch)
tree209cf1639a325875240fce3e1f1cabbdb25878df /sha1_file.c
parentcoccinelle: add a rule to make "type" code use FREE_AND_NULL() (diff)
downloadtgif-6a83d902073803c4141e02c53decf8c03e35da27.tar.xz
coccinelle: make use of the "type" FREE_AND_NULL() rule
Apply the result of the just-added coccinelle rule. This manually excludes a few occurrences, mostly things that resulted in many FREE_AND_NULL() on one line, that'll be manually fixed in a subsequent change. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 59a4ed2ed3..d67c88bb8d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -610,8 +610,7 @@ char *compute_alternate_path(const char *path, struct strbuf *err)
out:
if (seen_error) {
- free(ref_git);
- ref_git = NULL;
+ FREE_AND_NULL(ref_git);
}
return ref_git;