From: "Tim Van Holder" To: Subject: RE: O_TEMPORARY Date: Thu, 15 Feb 2001 18:44:13 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Precedence: bulk > + 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)?