Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-08-17 16:02:50 +0300
committerJunio C Hamano <gitster@pobox.com>2018-08-17 20:08:56 +0300
commitce528de023f82d767096b0342b6da8039feff7bc (patch)
tree53e85fcee37cfd8b2611c47915c3acbb53143d00 /branch.c
parent53f9a3e157dbbc901a02ac2c73346d375e24978c (diff)
refactor various if (x) FREE_AND_NULL(x) to just FREE_AND_NULL(x)
Change the few conditional uses of FREE_AND_NULL(x) to be unconditional. As noted in the standard[1] free(NULL) is perfectly valid, so we might as well leave this check up to the C library. 1. http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/branch.c b/branch.c
index f967c98f63..a2c9623d1d 100644
--- a/branch.c
+++ b/branch.c
@@ -25,9 +25,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
tracking->remote = remote->name;
} else {
free(tracking->spec.src);
- if (tracking->src) {
- FREE_AND_NULL(tracking->src);
- }
+ FREE_AND_NULL(tracking->src);
}
tracking->spec.src = NULL;
}