Skip to content

Commit

Permalink
lib/memcpy: Suppress a Coverity leak report for setup_tests()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bvanassche committed Jan 18, 2020
1 parent ed24e32 commit 655ca10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 655ca10

Please sign in to comment.