On Mon, Mar 25, 2013 at 9:00 PM, Dan Gora <dan.g...@gmail.com> wrote: > On Mon, Mar 25, 2013 at 4:54 PM, Zdenek Styblik > <zdenek.styb...@gmail.com> wrote: >> Because not every free() case needs this patch, I guess. I went >> through the sources again and it looks ok to me. > > Agreed.. I didn't see anything wrong with any of it, but to prove that > nothing is missing is a harder question... > >>> I guess I just don't really see what the point of this patch is. Is >>> there a bug somewhere where free'd memory is being accessed? If so, >>> it's probably better to just try and fix that. >> >> Yes, it's based on double-free() bug. > > So what is the bug exactly? How do you reproduce it? Can't we just > try and address that? > There are lots of tools to detect double frees and that sort of thing. >
Original diff to fix double-free issue in 'lib/ipmi_main.c' is attached. It's there and there is no doubt. And there can be bugs same as this one. >>> Although these changes don't really hurt anything they do clutter >>> things up quite a bit and don't have any effect in 99% of the cases. >>> >> >> I really don't see what the problem of setting pointer to NULL once it >> has been freed is. It rather seems as a good practice to me. I'm not >> sure about "cluttering" things either. >> > > Well code that doesn't do anything is, to my mind, clutter. Yes, it's > good practice to NULL out objects which have a non-local scope, but > just setting local variables to NULL doesn't do anything and will just > be optimized out. > Agree, still *shrug* Doing free on NULL seems to be harmless. Doing free on memory you don't own isn't. That's the point. I agree setting local variables/pointers to NULL can, and perhaps has, little-to-zero added value. > It's not a terribly big deal, but it seems better to fix the problem > at hand rather than adding a large diagnostic patch to the mainline. > I don't agree with this being diagnostic patch. It's rather trying to be a pragmatic(?) one. Z. > thanks > d
ipmi-dfree.patch
Description: Binary data
------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________ Ipmitool-devel mailing list Ipmitool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipmitool-devel