Bwar / CJsonObject

Ultralightweight JSON parser in C++ based on cJSON
MIT License
648 stars 239 forks source link

[CHG] Fix memory leak #50

Closed Vladivostoks closed 2 years ago

Vladivostoks commented 2 years ago

BUGS FOUND

Need clear self before using operator =(CJsonObject&& ) with rvalue to cover member in CJsonObject

CJsonObject FuncA()
{
    /*....*/
   return CJsonObject();
}

void main()
{
    CJsonObject  Ocjson;
    /*....*/
    // Memory leak found
    Ocjson =  FuncA();
    /*....*/
}