Skip to content

Commit

Permalink
Fixed memory leak for real this time.
Browse files Browse the repository at this point in the history
  • Loading branch information
epiller committed Mar 10, 2021
1 parent 3327b25 commit 71e39df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AllThingsTalk_LTEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ bool AllThingsTalk_LTEM::send(CborPayload &payload) {
topic[length-1] = 0;
if (mqtt.publish(topic, payload.getBytes(), payload.getSize(), 0, 0)) {
debug("> Message Published to AllThingsTalk (CBOR)");
delete topic;
return true;
} else {
debug("> Failed to Publish Message to AllThingsTalk (CBOR)");
delete topic;
return false;
}
delete topic;
}
} else {
debug("You're trying to send a message but you've disconnected from the network. Execute connect() to re-connect.");
Expand Down

0 comments on commit 71e39df

Please sign in to comment.