Remove memory leak into tests

pull/13171/head
Bernardo Bruning 3 years ago
parent 7f3f0a24f5
commit 204971e5db
  1. 2
      tests/test_cpp.cc

@ -171,7 +171,7 @@ TEST(Cpp, TimestampEncoder) {
for(long timestamp: timestamps) {
google_protobuf_Timestamp_set_seconds(timestamp_upb, timestamp);
char* json = new char[23];
char json[23];
size_t size = upb_JsonEncode(timestamp_upb, md.ptr(), NULL, 0, json, 23, NULL);
bool result = upb_JsonDecode(json, size, timestamp_upb_decoded, md.ptr(), NULL, 0, arena.ptr(), NULL);
const long timestamp_decoded = google_protobuf_Timestamp_seconds(timestamp_upb_decoded);

Loading…
Cancel
Save