Skip to content

Commit

Permalink
Fix leak of NIF exports
Browse files Browse the repository at this point in the history
  • Loading branch information
rickard-green committed Sep 5, 2014
1 parent eb3d3e8 commit 18a38b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions erts/emulator/beam/erl_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -11826,6 +11826,7 @@ erts_continue_exit_process(Process *p)
struct saved_calls *scb;
process_breakpoint_time_t *pbt;
erts_aint32_t state;
void *nif_export;

#ifdef DEBUG
int yield_allowed = 1;
Expand Down Expand Up @@ -11976,6 +11977,7 @@ erts_continue_exit_process(Process *p)
: NULL);
scb = ERTS_PROC_SET_SAVED_CALLS_BUF(p, ERTS_PROC_LOCKS_ALL, NULL);
pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL);
nif_export = ERTS_PROC_SET_NIF_TRAP_EXPORT(p, ERTS_PROC_LOCKS_ALL, NULL);

erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
#ifdef BM_COUNTERS
Expand Down Expand Up @@ -12023,6 +12025,9 @@ erts_continue_exit_process(Process *p)
if (pbt)
erts_free(ERTS_ALC_T_BPD, (void *) pbt);

if (nif_export)
erts_destroy_nif_export(nif_export);

delete_process(p);

#ifdef ERTS_SMP
Expand Down

0 comments on commit 18a38b9

Please sign in to comment.