diff options
| author | Vytautas Astrauskas <astrauv@amazon.com> | 2020-04-01 12:46:14 -0700 |
|---|---|---|
| committer | Vytautas Astrauskas <astrauv@amazon.com> | 2020-04-01 12:46:14 -0700 |
| commit | baa6d557a7b965ff8277f940a43e0ce3df3b8913 (patch) | |
| tree | 9df4e2e35e838a428357e81a8cb0b1910d6fa273 /src/libstd/sys/hermit | |
| parent | 5382347064ac47a2a5ac56b57cec0d91b9b40edc (diff) | |
| download | rust-baa6d557a7b965ff8277f940a43e0ce3df3b8913.tar.gz rust-baa6d557a7b965ff8277f940a43e0ce3df3b8913.zip | |
In Thread::new, add a comment that a panic could cause a memory leak.
Diffstat (limited to 'src/libstd/sys/hermit')
| -rw-r--r-- | src/libstd/sys/hermit/thread.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys/hermit/thread.rs b/src/libstd/sys/hermit/thread.rs index 6b009037805..4f20a6453fc 100644 --- a/src/libstd/sys/hermit/thread.rs +++ b/src/libstd/sys/hermit/thread.rs @@ -61,7 +61,7 @@ impl Thread { return if ret != 0 { // The thread failed to start and as a result p was not consumed. Therefore, it is // safe to reconstruct the box so that it gets deallocated. - let _ = Box::from_raw(p); + drop(Box::from_raw(p)); Err(io::Error::new(io::ErrorKind::Other, "Unable to create thread!")) } else { Ok(Thread { tid: tid }) |
