What happens when realloc() returns NULL?

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Sep 1 08:40:00 AEST 1989


In article <TOM.89Aug30231415 at yang.cpac.washington.edu> tom at yang.cpac.washington.edu (Tom May) writes:
>	p2 = realloc (p1, 200);
>... realloc() returns NULL, is the memory pointed to by p1 still allocated?

Yes, a properly implemented realloc() will not lose the old storage when
it cannot perform the reallocation.



More information about the Comp.lang.c mailing list