mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-16 15:44:56 +00:00
is Rich Coe. Also, a minor mod to Makefile.install.am to handle tool names with dashes in. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7112
28 lines
510 B
C
28 lines
510 B
C
#include <stdlib.h>
|
|
|
|
typedef struct
|
|
{
|
|
char *spointer1;
|
|
} structure;
|
|
|
|
structure **func1(void)
|
|
{
|
|
|
|
structure **pointer1 = 0;
|
|
|
|
pointer1 = (structure **)malloc(4 * sizeof(structure *)); /* Line 13 */
|
|
pointer1[1] = (structure *)malloc(sizeof(structure)); /* Line 14 */
|
|
pointer1[1]->spointer1 = (char *)malloc(64); /* Line 15 */
|
|
|
|
return pointer1;
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
structure **pointer1 = func1();
|
|
|
|
free(pointer1); /* Leak reports Line 24 */
|
|
|
|
return 0;
|
|
}
|