From 19c101281a4371909901b5d6ed26cba7296ce21c Mon Sep 17 00:00:00 2001 From: zack leung Date: Mon, 18 Oct 2021 23:46:10 +0000 Subject: libtests/calloc.c: Fix reported memory leak This fix came from Code Inspector, flagged by one of the analysis that was done. This test code is compiled only but better to address the issues so future static analysis reports will not include it. --- testsuites/libtests/POSIX/calloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuites/libtests/POSIX/calloc.c b/testsuites/libtests/POSIX/calloc.c index bd04faa800..a7537c8cc4 100644 --- a/testsuites/libtests/POSIX/calloc.c +++ b/testsuites/libtests/POSIX/calloc.c @@ -16,6 +16,8 @@ int main (void) { void *foo = calloc (42, 43); + int rc = (foo != NULL); + free(foo); - return (foo != NULL); + return rc; } -- cgit v1.2.3