From: nobu.nokada@... Date: 2002-08-23T23:52:40+09:00 Subject: Re: [Cleanup?] File (struct stat handling) Hi, At Fri, 23 Aug 2002 21:56:02 +0900, Michal Rokos wrote: > @@ -2024,12 +2028,11 @@ rb_stat_clone(obj) > > clone = rb_obj_alloc(RBASIC(obj)->klass); > CLONESETUP(clone,obj); > + > if (DATA_PTR(obj)) { > nst = ALLOC(struct stat); > - *nst = *(struct stat*)DATA_PTR(obj); > - DATA_PTR(clone) = nst; > + memcpy(DATA_PTR(clone), DATA_PTR(obj), sizeof(struct stat)); > } > - > return clone; > } Since File::Stat.allocate doesn't initialize DATA_PTR, this change causes SEGV, and also memory leak. > PS: Don't worry - no more patches are comming (It's weekend and > BankHoliday monday) :-) Don't mind, here is ruby-cleanup ML :-). -- Nobu Nakada