delorie.com/archives/browse.cgi | search |
From: | "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be> |
To: | <djgpp-workers AT delorie DOT com> |
Subject: | RE: O_TEMPORARY |
Date: | Thu, 15 Feb 2001 18:44:13 +0100 |
Message-ID: | <CAEGKOHJKAAFPKOCLHDIGEJOCAAA.tim.van.holder@pandora.be> |
MIME-Version: | 1.0 |
X-Priority: | 3 (Normal) |
X-MSMail-Priority: | Normal |
X-Mailer: | Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) |
Importance: | Normal |
In-Reply-To: | <3A8A98EE.30071.A8D978@localhost> |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4133.2400 |
Reply-To: | djgpp-workers AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp-workers AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
> + if (__o_temporary_files[fd] == NULL) > + return; > + if (--(__o_temporary_files[fd]->ref_count) == 0) > + { > + remove(__o_temporary_files[fd]->filename); > + free(__o_temporary_files[fd]); > + } > + __o_temporary_files[fd] = NULL; > + } Given that the dup() code makes two entries point to the same structure, shouldn't you look for other entries pointing to the structure you're about to free() and zero them to avoid leaving them pointing into the Great Void(tm)?
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |