While this is not an actual error, it does not represent Best Practice in C++ programming. In a number of places, such as in AdafruitIO_Group::_init, both malloc and new are used. The use of bare malloc in C++ is frowned upon. It is normally hidden inside the new operator. What is odd is that the computations are of the form
var = (char *)malloc(e);
for e being some expression. In C++, this can (and should) be written as
var = new char[e];
and therefore the odd mix of malloc/free and new/delete can be avoided.
While this is not an actual error, it does not represent Best Practice in C++ programming. In a number of places, such as in AdafruitIO_Group::_init, both malloc and new are used. The use of bare malloc in C++ is frowned upon. It is normally hidden inside the new operator. What is odd is that the computations are of the form
var = (char *)malloc(e);
for e being some expression. In C++, this can (and should) be written asvar = new char[e];
and therefore the odd mix of malloc/free and new/delete can be avoided.