Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 7 months ago.
hello sir, this mqtt publisher fails after 110 publishes. can you explain why?
hello sir, this mqtt publisher fails after 110 publishes. can you explain why?
Question relating to:
![](/media/cache/profiles/7d65939039592cca91c51ef731f768e4.jpg.50x50_q85.jpg)
1 Answer
9 years, 7 months ago.
If it fails after 110 every time, or around 110 it sound like a memory leak.
Just had a quick look at main.cpp
char * value = new char [37]; strcpy(value, data.c_str()); mqtt.publish(pub_topic, value);
If you ever see a new without a delete in c++ it's a bad sign. I don't know how this library works but this probably isn't right.