Assuming that I have allocated memory using
char *newline = realloc ( oldline , newsize );
// Assuming oldline is the pointer to which the starting address
// of the memory which malloc() has returned, is assigned and,
// say, newsize is integer having 100 value.
It depend if
realloc was successful or not. If
realloc is successful then:
No ! For example, if there is not enough contiguous memory after
newline will be different from
oldline has been freed if necessary. After a realloc
oldline should be considered as invalid pointer.
If it is not successful. Then, you use
oldline as if nothing happened, in particular you should free it.