projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ed24e32
)
lib/memcpy: Suppress a Coverity leak report for setup_tests()
author
Bart Van Assche
<bvanassche@acm.org>
Sat, 18 Jan 2020 05:02:00 +0000
(21:02 -0800)
committer
Bart Van Assche
<bvanassche@acm.org>
Sat, 18 Jan 2020 06:04:39 +0000
(22:04 -0800)
Suppress the following Coverity memory leak complaint:
CID 169324 (#1 of 1): Resource leak (RESOURCE_LEAK)
7. leaked_storage: Variable src going out of scope leaks the storage it points to.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
lib/memcpy.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/memcpy.c
b/lib/memcpy.c
index cf8572e270898a14c3fb3daf8be047c3bbcedd1c..a552134357131e2e2438deb44764fc61b6ec06be 100644
(file)
--- a/
lib/memcpy.c
+++ b/
lib/memcpy.c
@@
-201,6
+201,9
@@
static int setup_tests(void)
void *src, *dst;
int i;
+ if (!tests[0].name)
+ return 0;
+
src = malloc(BUF_SIZE);
dst = malloc(BUF_SIZE);
if (!src || !dst) {