M
Mike
Hello,
I have following existing code. And there is memory leak. Anyone know
how to get ride of it? function foo has been used in thousands places,
the signature is not allowed to change.
Thanks in advance,
my_struc * foo1( )
{
my_struc * tmp;
tmp = (my_struc *)calloc(1, sizeof(my_struc));
return tmp;
}
void main()
{
my_struc *mainPtr;
mainPtr = foo1();
free(mainPtr);
}
I have following existing code. And there is memory leak. Anyone know
how to get ride of it? function foo has been used in thousands places,
the signature is not allowed to change.
Thanks in advance,
my_struc * foo1( )
{
my_struc * tmp;
tmp = (my_struc *)calloc(1, sizeof(my_struc));
return tmp;
}
void main()
{
my_struc *mainPtr;
mainPtr = foo1();
free(mainPtr);
}