rapidjson icon indicating copy to clipboard operation
rapidjson copied to clipboard

fix missing check allocator is reference in ClearStack()

Open xiegx94 opened this issue 3 years ago • 1 comments

ClearStack() function in document.h misses check allocator type. This would cause memory leak if parse failed. Such as following code:

int main()
{
    if (1) {
      rapidjson::Document doc;
      auto& ret = doc.Parse<0>(R"(
        {"a":"a","b":"b"}, {"c":"c"}
      )");
    }
    return 0;
}

xiegx94 avatar Oct 09 '22 06:10 xiegx94

CLA assistant check
All committers have signed the CLA.

tencent-adm avatar Oct 09 '22 06:10 tencent-adm