Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocation/deallocation bugs #63

Open
supuflounder opened this issue Aug 23, 2018 · 1 comment
Open

Allocation/deallocation bugs #63

supuflounder opened this issue Aug 23, 2018 · 1 comment
Labels
Milestone

Comments

@supuflounder
Copy link

supuflounder commented Aug 23, 2018

In traipsing through the code, I found a few more bugs. This list includes the delete _get_pub bug I reported earlier

AdafruitIO_Feed.cpp:    delete _get_pub;    // jmn-bug
AdafruitIO_Group.cpp:    // There is no test to see of _sub and _pub allocations succeeded // jmn-bug
AdafruitIO_Group.cpp:    // If _sub is NULL, the behavior of the remaining method calls    // jmn-bug
AdafruitIO_Group.cpp:    // is undefined                                                   // jmn-bug
AdafruitIO_Group.cpp:    // This code is incorrect; if, for example, _topic was allocated // jmn-bug
AdafruitIO_Group.cpp:    // but _create_url failed, then setting topic to NULL (neé 0)    // jmn-bug
AdafruitIO_Group.cpp:    // will cause a memory leak                                      // jmn-bug
AdafruitIO_Group.cpp:    // correct code would be                                         // jmn-bug
AdafruitIO_Group.cpp:    // if(_topic != NULL)                                            // jmn-bug
AdafruitIO_Group.cpp:    //   { /* has topic */                                           // jmn-bug
AdafruitIO_Group.cpp:    //    free(_topic);                                              // jmn-bug
AdafruitIO_Group.cpp:    //    _topic = NULL;                                             // jmn-bug
AdafruitIO_Group.cpp:    //   } /* has topic */                                           // jmn-bug
AdafruitIO_Group.cpp:    // Repeat for _create_url and _group_url                         // jmn-bug
@brentru brentru added the bug label Aug 23, 2018
@brentru brentru added this to the 2.7.17 milestone Aug 23, 2018
@brentru
Copy link
Member

brentru commented Aug 23, 2018

Thanks for reporting them and your continued bughunt. I'm going to be doing some library work on Saturday to test/patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants