|
From: | Paul Eggert |
Subject: | Re: tar - covscan issues |
Date: | Thu, 8 Apr 2021 11:50:35 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |