realloc

Doug Gwyn gwyn at smoke.brl.mil
Wed Apr 24 06:18:07 AEST 1991


In article <1991Apr23.045937.178 at Think.COM> barmar at think.com (Barry Margolin) writes:
>... the common practice of
>	fooptr = realloc (fooptr, newsize);
>results in a memory leak whenever realloc() returns a null pointer.

People who would write that code would probably also fail to test for a
null pointer being returned anyway, so they have a bigger problem than
memory leaks.  (Your suggested solution is fine.)



More information about the Comp.std.c mailing list