Re: [Patch] String and (repost) MemLeak
From:
Michal Rokos <michal@...>
Date:
2003-03-04 21:00:26 UTC
List:
ruby-core #917
Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [Patch] String and (repost) MemLeak" > on 03/03/05, Michal Rokos <michal@rokos.homeip.net> writes: > > |PS: Maybe checking whether ptr is not NULL in rb_str_buf_cat wasn't such > |a bad point (unlike the rest thing about setting len)... > > I think rb_str_buf() requires ptr not to be NULL, so that check isn't > needed at all. MEMZERO() will be removed too. Hmm, I messed it up again - I'm very sorry... So: I think that line 590 memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len); in rb_str_buf_cat() assumes that ptr is not NULL, but it's not checked. And MEMZERO is redundant in rb_str_cat()? Could be... Michal