Behaviour of malloc with delete in C++

This is undefined behaviour, as there’s no way to reliably prove that memory behind the pointer was allocated correctly (i.e. by new for delete or new[] for delete[]). It’s your job to ensure things like that don’t happen. It’s simple when you use right tools, namely smart pointers. Whenever you say delete, you’re doing it wrong.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)