Skip to content

Commit

Permalink
Merge pull request #8696 from dlang/revert-8695-patch-1
Browse files Browse the repository at this point in the history
Revert "Memory leak on std.process"
  • Loading branch information
RazvanN7 authored Feb 21, 2023
2 parents b77c739 + fa5d1b1 commit 29ff69f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions std/process.d
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ private Pid spawnProcessPosix(scope const(char[])[] args,
// signal safe functions list, but practically this should
// not be a problem. Java VM and CPython also use malloc()
// in its own implementation via opendir().
import core.stdc.stdlib : malloc, free;
import core.stdc.stdlib : malloc;
import core.sys.posix.poll : pollfd, poll, POLLNVAL;
import core.sys.posix.sys.resource : rlimit, getrlimit, RLIMIT_NOFILE;

Expand All @@ -1055,7 +1055,6 @@ private Pid spawnProcessPosix(scope const(char[])[] args,

// Call poll() to see which ones are actually open:
auto pfds = cast(pollfd*) malloc(pollfd.sizeof * maxToClose);
scope(exit) free(pfds);
if (pfds is null)
{
abortOnError(forkPipeOut, InternalError.malloc, .errno);
Expand Down

0 comments on commit 29ff69f

Please sign in to comment.