I am observing code is dumping at that point in the load. since we are allocating dynamically memory each time
is there any probiem if we do malloc and free inside infinite while loop..?
Collapse
X
-
Tags: None
-
Nothing wrong with an infinite loop that malloc's some memory, then frees it, then goes back to the top of the loop. If you don't free all the memory then you have a "memory leak" -- that is a problem regardless of whether you have an infinite loop.
A core dump indicates a serious problem. Are you trapping the malloc error return (ie, when it returns NULL)? -
-
Comment
Comment