From: "Robert Collins" <[EMAIL PROTECTED]> To: "Pavel Tsekov" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: "Seitz, Matt" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, March 22, 2002 20:33 Subject: RE: [Possible BUG and a fix] Re[2]: Setup.Exe causes Application Error at 0x78001750
> From: Pavel Tsekov [mailto:[EMAIL PROTECTED]] > Sent: Saturday, March 23, 2002 11:03 AM > strcpy (dp, dots); > delete[] dots; > key = String (dp); > > LOOK HERE - This is not right - we should delete at the base > of the block, not somewhere in the middle of it. > delete[] dp; > > We can do something like that > char *dp = .... > char *dp_save = dp; > > .... > > delete[] dp_save; ] Huh? delete[]dp; is the last reference to dp. delete[]dots; is the last ] reference to dots. Whats the problem? dp is modified so doesn't point to the base of the allocated area by the time delete[] dp is called. A separate working variable should be used rather than modifying the allocation pointer. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age. Changelog: 2002-03-22 Michael A Chase <[EMAIL PROTECTED]> * site.cc (site_list_type::init): Preserve allocation pointer for key buffer.
cinstall-mac-020322-1.patch
Description: Binary data