www.delorie.com/archives/browse.cgi | search |
From: | yhirsch <yhirsch AT ibm DOT net> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Problems with MALLOC and FREE |
Date: | Tue, 21 Dec 1999 01:49:29 +0200 |
Organization: | Unspecified Organization |
Lines: | 15 |
Message-ID: | <385EC088.8403BF22@ibm.net> |
References: | <Pine DOT SUN DOT 3 DOT 91 DOT 991209160149 DOT 22560D-100000 AT is> <82rh3j$sfu AT cantine DOT wu-wien DOT ac DOT at> |
NNTP-Posting-Host: | slip139-92-253-47.tel.il.ibm.net |
Mime-Version: | 1.0 |
X-Trace: | news.ibm.net.il!ibm.net 945734061 22466 (none) 139.92.253.47 |
X-Complaints-To: | postmaster AT ibm DOT net |
X-Mailer: | Mozilla 4.03 [en] (Win95; I) |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Hi. The first part doesn't cause any problem naturally, but you have to check if you free parts of that array during the program BEFORE shutdown! That's very important, because if you do and don't set those parts back to NULL, it means that at shutdown, you're trying to free areas in memory that have already been freed - which causes a SIGSEV error. So remember, if, at some point, you free memory - set the pointer to NULL. Hope this helps. Yaron
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |