mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-22 01:24:05 +00:00
Only call pb_release when validDecode.
This commit is contained in:
parent
de628f5649
commit
d9b900b287
@ -48,7 +48,11 @@ struct DecodedServiceEnvelope : public meshtastic_ServiceEnvelope {
|
||||
validDecode(pb_decode_from_bytes(payload, length, &meshtastic_ServiceEnvelope_msg, this))
|
||||
{
|
||||
}
|
||||
~DecodedServiceEnvelope() { pb_release(&meshtastic_ServiceEnvelope_msg, this); }
|
||||
~DecodedServiceEnvelope()
|
||||
{
|
||||
if (validDecode)
|
||||
pb_release(&meshtastic_ServiceEnvelope_msg, this);
|
||||
}
|
||||
// Clients must check that this is true before using.
|
||||
const bool validDecode;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user