[vdr] *** glibc detected *** double free or corruption 1.4.2-1 Patch

Udo Richter udo_richter at gmx.de
Fri Sep 8 16:58:10 CEST 2006

Hans-Werner Hilse wrote:
> bug... The free() *does* hurt, however. The standard tells us not to
> free a pointer twice (in fact, the man page suggests that "undefined
> behaviour occurs"). That's why there is this "double free assertion", I
> think. But what my solution suggested was just a circumvention of that
> assertion, not the bug itself. 

I don't agree. The double free assertion wont be issued if you free NULL 
twice. Its good style to NULL unused pointers so they can always be 
safely free'd, but if you do have double free assertions, then the bug 
is not the missing if (aux), its the fact that aux was not properly 
NULLed after the first free.

In this case the cTimer object was improperly doubled, and you would 
have to NULL the pointers in both objects manually, though both copies 
don't know anything about each other.



More information about the vdr mailing list