don/NDEF

Memory leak on NdefRecord deconstructor

Opened this issue · 0 comments

Writing multiple times a NFC tag causes a memory leak.
I've changed the NdefRecord deconstructor in this way to prevent the leak:

NdefRecord::~NdefRecord()
{
    //Serial.println("NdefRecord Destructor");
    if (_type)
    {
        free(_type);
    }

    if (_payload)
    {
        free(_payload);
    }

    if (_id)
    {
        free(_id);
    }
}