Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!ncifcrf!lhc!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: realloc Message-ID: <15952@smoke.brl.mil> Date: 23 Apr 91 20:18:07 GMT References: <91112.102011LSC@SLACVM.SLAC.STANFORD.EDU> <1991Apr23.001451.14900@tkou02.enet.dec.com> <1991Apr23.045937.178@Think.COM> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 8 In article <1991Apr23.045937.178@Think.COM> barmar@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.)