Skip to content

Commit

Permalink
http bugfix: address memory leak in after_send caused by std::mem::fo…
Browse files Browse the repository at this point in the history
…rget
  • Loading branch information
jbr committed Oct 24, 2023
1 parent a8e9a24 commit 82ec3c1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions http/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,7 @@ where
}

bufwriter.flush().await?;

let mut after_send = std::mem::take(&mut self.after_send);
after_send.call(true.into());
std::mem::forget(after_send);

self.after_send.call(true.into());
self.finish().await
}

Expand Down

0 comments on commit 82ec3c1

Please sign in to comment.