I have a struct containing a bunch of char pointers whose values are used throughout the program's lifetime. Most are overwritten every iteration.
Should these values be freed at any point besides program exit? Should the value in the char pointer be freed before overwriting it with strdup("new value")
?
@some-programmer-dude is right, there will be memory leak without free if your program works like a server.
BTW, all memory will be released after the program exited no matter whether you call free() or not.