#142 Incorrect behavior of __node_alloc_impl::_S_chunk_dealloc

5.1
closed
5
2007-09-04
2007-09-04
Sergej Zagursky
No

The last line of __node_alloc_impl::_S_chunk_dealloc() is:
memset(__REINTERPRET_CAST(char*, _S_free_list[0]), 0, _STLP_NFREELISTS * sizeof(_Obj*));
But should be:
memset(__REINTERPRET_CAST(char*, &_S_free_list[0]), 0, _STLP_NFREELISTS * sizeof(_Obj*)); // note ampersand before '_S_free_list[0]'

It seems that this bug is limited to case when the _STLP_LEAKS_PEDANTIC define is set to 1.

Discussion

  • Logged In: YES
    user_id=1096600
    Originator: NO

    Thanks for the report, you are right it is only called if _STLP_LEAKS_PEDANTIC is defined and moreover only when application stop or when some dll is unloaded.

    Bests

     
    • assigned_to: nobody --> dums
    • status: open --> closed