All these GNU Tar Coverity reports appear to be false alarms. Here are
some details:
On 4/7/21 1:24 AM, Ondrej Dubaj wrote:
- return copy != NULL ? copy : data;
+ if (copy != NULL)
+ {
+ data = NULL;
+ return copy;
+ }
+ else
+ return data;
This patch doesn't do anything since 'data' is a local variable, which
means setting it to NULL has no effect. If the patch pacifies Coverity,
it's a bug in Coverity.
}
}
libc_hidden_def (__libc_scratch_buffer_dupfree)
diff --git a/lib/wordsplit.c b/lib/wordsplit.c
index 661a4f8..6ccaa2a 100644
--- a/lib/wordsplit.c
+++ b/lib/wordsplit.c
@@ -615,7 +615,6 @@ coalesce_segment (struct wordsplit *wsp, struct
wordsplit_node *node)
node->flags |= p->flags & _WSNF_QUOTE;
wsnode_remove (wsp, p);
stop = p == end;
- wsnode_free (p);
}
p = next;
}
This patch would cause a memory leak, no? Also, the calling code doesn't
use p->next in this case, so this appears to be a Coverity false alarm.
There is a compiler warning about issues in utimens.c, which I find as
false positives.
Although report is also a false positive, it's an understandable one
since the code uses the wrong declaration (albeit technically correct).
I attempted to pacify Coverity by installing the following patch into
Gnulib; please give it a try.
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=a3a946f670718d0dee5a7425ad5ac0a29fb46ea1