mirror of https://github.com/fafhrd91/actix-web
fix raw fd drop.
This commit is contained in:
parent
3e578e839b
commit
9ffabe946f
|
@ -197,7 +197,9 @@ impl NamedFile {
|
||||||
// SAFETY: fd is borrowed and lives longer than the unsafe block.
|
// SAFETY: fd is borrowed and lives longer than the unsafe block.
|
||||||
unsafe {
|
unsafe {
|
||||||
let fs = std::fs::File::from_raw_fd(fd);
|
let fs = std::fs::File::from_raw_fd(fd);
|
||||||
fs.metadata()?
|
let md = fs.metadata()?;
|
||||||
|
std::mem::forget(fs);
|
||||||
|
md
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue