Don't free stringargs during deep copy

spawnsectors is memcpy'd over just before the calls to copy_stringarg,
resulting in copy_stringarg Z_Free'ing the exact string it is about to
copy. This is a silent memory error, as the malloc block appears to
still be in a virtual-allocated page after the call to Z_Free.

deepcopy is not able to properly free the target array's tree of objects
if the target already exists, so that will need future work.
This commit is contained in:
Eidolon 2025-03-03 18:29:04 -06:00
parent 44131bb9a7
commit 47487b7610

View file

@ -142,11 +142,6 @@ static void copy_stringarg(char **target, const char *source)
// on how it is copied over instead of just
// using strcpy or smth
if (*target != nullptr)
{
Z_Free(*target);
}
size_t len = 0;
if (source != nullptr)
{