mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
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:
parent
949c398327
commit
e65fe614b7
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue