diff options
author | Lukas Larsson <[email protected]> | 2015-09-28 11:02:40 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2015-12-15 10:05:46 +0100 |
commit | e56d78b761680d83ab61045a62d4fc7bdb312b3c (patch) | |
tree | 57eba60a5089d26fcaf464748e98e5087c14cbd6 | |
parent | 200247f972b012ced0c4b2c6611f091af66ebedd (diff) | |
download | otp-e56d78b761680d83ab61045a62d4fc7bdb312b3c.tar.gz otp-e56d78b761680d83ab61045a62d4fc7bdb312b3c.tar.bz2 otp-e56d78b761680d83ab61045a62d4fc7bdb312b3c.zip |
erts: Fix memory leak at async open port
When an async open port fails early, it would sometimes
leak memory.
-rw-r--r-- | erts/emulator/beam/io.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index fc247a3260..df8a213a1d 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -479,6 +479,11 @@ erts_port_free(Port *prt) erts_port_task_fini_sched(&prt->sched); + if (prt->async_open_port) { + erts_free(ERTS_ALC_T_PRTSD, prt->async_open_port); + prt->async_open_port = NULL; + } + #ifdef ERTS_SMP ASSERT(prt->lock); if (state & ERTS_PORT_SFLG_PORT_SPECIFIC_LOCK) |