Files
rtems/testsuites/libtests/POSIX/calloc.c
zack leung 19c101281a 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.
2021-11-03 08:39:12 -05:00

24 lines
392 B
C

/*
* Copyright (c) 2009 by
* Ralf Corsépius, Ulm, Germany. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software
* is freely granted, provided that this notice is preserved.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
int
main (void)
{
void *foo = calloc (42, 43);
int rc = (foo != NULL);
free(foo);
return rc;
}