delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/19/05:28:54

From: dontmailme AT iname DOT com (Steamer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: free crashes
Date: Mon, 19 Jun 2000 08:19:09 GMT
Organization: always disorganized
Lines: 17
Message-ID: <394dd778.6486409@news.freeserve.net>
References: <394BC51F DOT B6B956C1 AT ne DOT infi DOT net> <394BE835 DOT D7C0D958 AT connect DOT ab DOT ca>
NNTP-Posting-Host: modem-150.algae-blennie.dialup.pol.co.uk
X-Trace: newsg2.svr.pol.co.uk 961402749 14467 62.136.222.150 (19 Jun 2000 08:19:09 GMT)
NNTP-Posting-Date: 19 Jun 2000 08:19:09 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tom Fjellstrom wrote:

> > my program works fine, except when the line at the very end of my code
> > comes along:
> > 
> > free(bmp.data);
> > 
> > then it crashes.  what in the world could cause this?!
> 
> I really wouldn't have a clue without seeing a better example,
> but i could suggest replacing that line with
> if(bmp.data) free(bmp.data);

That would make no difference at all, because free(NULL) is defined
to do nothing.

S.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019