I've declared a local variable as char* in my function (non-static) and then I've done malloc() to reserve some memory for it.
I then use the variable and return from my function.
If I don't free() the memory, will it be deallocated anyway since it is only in scope within the function?
I seem to be getting a core dump when calling free() and wondered if it is because I'm calling strtok on my local variable.
Thanks in advance for any help.
I then use the variable and return from my function.
If I don't free() the memory, will it be deallocated anyway since it is only in scope within the function?
I seem to be getting a core dump when calling free() and wondered if it is because I'm calling strtok on my local variable.
Thanks in advance for any help.