Fix shocking memory leak on Windows

Spawning processes would leak lots of memory, due to a missing free call
in ntspawn(). Our tooling never caught this since ntspawn() must use the
WIN32 memory allocator. It means every time posix_spawn, fork, or execve
got called, we would leak 162kb of memory. I'm proud to say that's fixed
This commit is contained in:
Justine Tunney 2024-09-15 04:24:20 -07:00
parent 949c398327
commit e65fe614b7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -238,6 +238,7 @@ textwindows int ntspawn(struct NtSpawnArgs *args) {
BLOCK_SIGNALS;
if ((sb = ntspawn_malloc(sizeof(*sb)))) {
rc = ntspawn2(args, sb);
ntspawn_free(sb);
} else {
rc = -1;
}