If you're periodically running into undefined behavior, valgrind might be able to identify cases you haven't noticed.
Ruling out these cases might be helpful.
Type: Posts; User: JonA
If you're periodically running into undefined behavior, valgrind might be able to identify cases you haven't noticed.
Ruling out these cases might be helpful.
Sure. That's done by tracking your own allocations and then freeing each when you wish.
There are all sorts of ways to do this. Most people just use the manual approach. Save pointers in a...
7.22.3.3 The free function
"The free function causes the space pointed to by ptr to be deallocated ..."
The entire allocated space based on a prior call to malloc / realloc / calloc and which...
It's interesting (and rather common) for someone to ask how to do X (help with pointers), but that question is a distraction from the real problem.
In this case, you never needed that new pointer...
Try following the value of pfile. :)
1) Your programs will tend to be a bit more robust if you consistently check validity of passed parameters in the called function. If a function is passed a pointer, at least make sure the pointer...