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.



vdr mailing list

Reply via email to