Ok this is odd. I have this code.
Code:
int main(int argc, char *argv[])
{
LETTERSTATS *letterStatsArray = (LETTERSTATS*)malloc(sizeof(LETTERSTATS) * 5);
PANVOWELSTATS *panvowels = (PANVOWELSTATS*)malloc(sizeof(PANVOWELSTATS));
initializePanvowels(panvowels);
initializeLetterStats(letterStatsArray , 5);
freeLetterStats(letterStatsArray , 5);
free(letterStatsArray);
freePanvowelStats(panvowels);
free(panvowels);
return 0;
}
Code:
$ gcc --version
gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ valgrind ./a.out
==2094== Memcheck, a memory error detector
==2094== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==2094== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==2094== Command: ./a.out
==2094==
==2094==
==2094== HEAP SUMMARY:
==2094== in use at exit: 0 bytes in 0 blocks
==2094== total heap usage: 14 allocs, 14 frees, 1,284 bytes allocated
==2094==
==2094== All heap blocks were freed -- no leaks are possible
==2094==
==2094== For counts of detected and suppressed errors, rerun with: -v
==2094== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 12 from 8)
Maybe did you forget to re-compile after making changes?