*** glibc detected *** double free or corruption 1.4.2-1 Patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Cheers,

Udo


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux