mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8333361: ubsan,test : libHeapMonitorTest.cpp:518:9: runtime error: null pointer passed as argument 2, which is declared to never be null
Reviewed-by: asteiner, lucy, amenkov
This commit is contained in:
parent
bdd96604ae
commit
ed149062d0
1 changed files with 3 additions and 1 deletions
|
@ -515,7 +515,9 @@ static void event_storage_augment_storage(EventStorage* storage) {
|
|||
ObjectTrace** new_objects = reinterpret_cast<ObjectTrace**>(malloc(new_max * sizeof(*new_objects)));
|
||||
|
||||
int current_count = storage->live_object_count;
|
||||
memcpy(new_objects, storage->live_objects, current_count * sizeof(*new_objects));
|
||||
if (storage->live_objects != nullptr) {
|
||||
memcpy(new_objects, storage->live_objects, current_count * sizeof(*new_objects));
|
||||
}
|
||||
free(storage->live_objects);
|
||||
storage->live_objects = new_objects;
|
||||
storage->live_object_size = new_max;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue