diff options
author | Lukas Larsson <[email protected]> | 2017-06-14 17:30:02 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-06-14 17:30:02 +0200 |
commit | 37faaedc1d7aedf66c29130794e8339b96c051d8 (patch) | |
tree | 86eba709badddb2a01220492bafabf3b24a454b2 | |
parent | 5a42fa760c2d908c0724a6e49a1f25a82b5b7792 (diff) | |
download | otp-37faaedc1d7aedf66c29130794e8339b96c051d8.tar.gz otp-37faaedc1d7aedf66c29130794e8339b96c051d8.tar.bz2 otp-37faaedc1d7aedf66c29130794e8339b96c051d8.zip |
fixup! erts: Cleanup dropped port tasks correctly
-rw-r--r-- | erts/emulator/beam/erl_port_task.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c index 8d78b22228..2083a43f69 100644 --- a/erts/emulator/beam/erl_port_task.c +++ b/erts/emulator/beam/erl_port_task.c @@ -1624,8 +1624,9 @@ abort_nosuspend: ASSERT(ns_pthlp); erts_free(ERTS_ALC_T_PT_HNDL_LIST, ns_pthlp); - if (ptp) - port_task_free(ptp); + + ASSERT(ptp); + port_task_free(ptp); return 0; @@ -1636,15 +1637,15 @@ fail: erts_port_dec_refc(pp); #endif - abort_signal_task(pp, ERTS_PROC2PORT_SIG_ABORT, - ptp->type, &ptp->u.alive.td, 0); + if (ptp) { + abort_signal_task(pp, ERTS_PROC2PORT_SIG_ABORT, + ptp->type, &ptp->u.alive.td, 0); + port_task_free(ptp); + } if (ns_pthlp) erts_free(ERTS_ALC_T_PT_HNDL_LIST, ns_pthlp); - if (ptp) - port_task_free(ptp); - return -1; } |