We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdd9660 commit ed14906Copy full SHA for ed14906
test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.cpp
@@ -515,7 +515,9 @@ static void event_storage_augment_storage(EventStorage* storage) {
515
ObjectTrace** new_objects = reinterpret_cast<ObjectTrace**>(malloc(new_max * sizeof(*new_objects)));
516
517
int current_count = storage->live_object_count;
518
- memcpy(new_objects, storage->live_objects, current_count * sizeof(*new_objects));
+ if (storage->live_objects != nullptr) {
519
+ memcpy(new_objects, storage->live_objects, current_count * sizeof(*new_objects));
520
+ }
521
free(storage->live_objects);
522
storage->live_objects = new_objects;
523
storage->live_object_size = new_max;
0 commit comments