Skip to content

Commit

Permalink
Memory leak in the relay interpreter (#3448)
Browse files Browse the repository at this point in the history
  • Loading branch information
hlu1 authored and tqchen committed Jun 28, 2019
1 parent b05dc12 commit 9b3e83f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/relay/backend/interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ class Interpreter :
auto closure = ClosureNode::make(captured_mod, func);
auto mut_closure =
static_cast<ClosureNode*>(const_cast<Node*>(closure.get()));
mut_closure->env.Set(letrec_name, closure);
if (letrec_name.defined()) {
mut_closure->env.Set(letrec_name, closure);
}
return std::move(closure);
}

Expand Down

0 comments on commit 9b3e83f

Please sign in to comment.