Isolated a string object to a brace block to prevent memory leakage and program crash when the application is using a different allocator