here is the code for vfree (it is being called on to pointers to strings (char*'s, dynamically allocated):
Code:
/**
* Function: FreeString
* --------------------
* Understands how to free a C-string. This
* function should be used by all vectors that
* store char *'s (but only when those char *s
* point to dynamically allocated memory, as
* they do with strings.)
*/
static void FreeString(void *elemAddr)
{
char *s = *(char **) elemAddr;
free(s);
}
/**
* Function: PrintString
* ---------------------
* Understands how to print a C-string stored
* inside a vector. The target FILE * should
* be passed in via the auxData parameter.
*/
static void PrintString(void *elemAddr, void *auxData)
{
char *word = *(char **)elemAddr;
FILE *fp = (FILE *) auxData;
fprintf(fp, "\t%s\n", word);
}
the thing is that this code was given tome by the project file so it cant be wrong..i suspect there is something wrong what i am calling vfree ON...?