Missing move constructor and operator= override in class PubSubClient leads to reuse of freed pointer buffer. Which in turn leads to memory corruption when trying to use the object with functions accessing buffer.
Replication:
PubSubClient client = PubSubClient(); // -> Calls default constructor, then copy constructor, then destructor for rvalue behind equals
Expected behavior:
Move constructor should copy the old value and replace buffer of old object with 0 so free ignores it
Missing move constructor and operator= override in class PubSubClient leads to reuse of freed pointer buffer. Which in turn leads to memory corruption when trying to use the object with functions accessing buffer.
Replication:
Expected behavior: Move constructor should copy the old value and replace buffer of old object with 0 so free ignores it