Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Endlisnis , Grzegorz Adam Hankiewicz , djgpp AT delorie DOT com Date: Fri, 7 Aug 1998 13:03:16 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: How do I free the allocated memory? In-reply-to: <35CB1C54.ECBF9EB@unb.ca> Precedence: bulk Endlisnis wrote: > Salvador Eduardo Tropea (SET) wrote: > > > 1) Don't allocate the memory before checking new_str. > > > char *new_str; > > > if (new_str == NULL) return NULL; > > SET > > Isn't 'new_str' initalized to whatever happens to be in memory? Isn't the whole point to check to see if > malloc was able to allocate the space? If so, how could you check for an error before the function is called? I allready rectified it, is old_str .... ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013