In the program I am working on I have a struct like
typedef struct _mystruct{
char* my_string;
} mystruct;
Most of the time the time my_string is allocated using malloc, so there is a function that calls
free(mystructa->my_string);
Generally this works, but at some points, my_string is set as a literal
my_string = "This is a literal";
Is there a way to tell the difference between the two before my call to free()?