I am trying to find the issue with a bit of C code that I have. The debugger says that the error occurs when I try to free the mem from a pointer:
int main(int argc, char *argv[]){
char *desc = malloc(30 * sizeof(char));
if(desc == NULL)
{
fprintf(stderr, "Error - cannot allocate memory\n");
}
desc = "Debug this program.";
printf("Description: %s\n", desc);
free(desc);//break point here
int cpid = fork();
....