Use the correct allocator when archiving a con_set object
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s

The default c++ allocator was be used to allocate an array of pointers, but then when destroying the array, Z_Free was called which would throw an error
This commit is contained in:
smallmodel 2025-02-22 23:29:40 +01:00
parent 32ba71693c
commit 2c72908f76
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -293,7 +293,7 @@ void con_set<key, value>::Archive(Archiver& arc)
if (arc.Loading()) {
if (tableLength != 1) {
table = new Entry *[tableLength]();
table = new (NewTable(tableLength)) Entry *[tableLength]();
memset(table, 0, tableLength * sizeof(Entry *));
}