Re: cu coredumps (fwd)

看板DFBSD_bugs作者時間21年前 (2004/10/28 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/4 (看更多)
Let me say that I wholeheartedly agree. I wrote it more as a joke rather then a practical solution (didn't you notice :) in the end?). And I also concur that malloc() call must be checked. I missed it :/ and should've caught it right away. Regards, -- Timour Ezeev Pivotal Dynamics timour@pivotaldynamics.com V: 305.406.9904 F: 305.406.9689 On Wed, 27 Oct 2004, Diane Bruce wrote: > On Wed, Oct 27, 2004 at 12:51:51PM -0400, Timour Ezeev wrote: >> > ... >> (int)tmp_cp ^= (int)cp; (int)cp ^= (int)tmp_cp; (int)tmp_cp ^= >> (int)cp; >> free(tmp_cp); > > I'd fire any coder working for me that wrote that. > > You are worried about what? about up to 10 bytes that gets lost > from malloc for the life of this program? Good grief. I'd be slightly > more worried about you not checking for a NULL result from malloc(). > > - Diane >
文章代碼(AID): #11V-A400 (DFBSD_bugs)
文章代碼(AID): #11V-A400 (DFBSD_bugs)