Karthik Nayak [off-list ref] writes:
I could send in this patch for coccinelle with the fixup if that's okay
with you.
This patch until it gets fixed will take the coccinelle updates
hostage, so let's queue the following on top before merging it down
to 'next'.
----- >8 -----
Subject: [PATCH] receive-pack: coccinelle fix
Let's not check the nullness of cmd->error_string_owned before
calling FREE_AND_NULL(cmd->error_string_owned). It is cheap and
safe to call FREE_AND_NULL(variable) for a variable that has NULL
in it.
Signed-off-by: Junio C Hamano <redacted>
---
builtin/receive-pack.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 9ac7717096..1d5b050beb 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2452,8 +2452,7 @@ static void update_shallow_info(struct command *commands,
static void override_cmds_error(struct command *commands, const char *err)
{
for (struct command *cmd = commands; cmd; cmd = cmd->next) {
- if (cmd->error_string_owned)
- FREE_AND_NULL(cmd->error_string_owned);
+ FREE_AND_NULL(cmd->error_string_owned);
cmd->error_string = err;
}
}--
2.56.0-rc0-195-g1e3108ffbb