Calling init multiple times will leak AtomicPtr in slot with thread panicking.
labyrinth-ssr opened this issue · comments
signal-hook/src/iterator/exfiltrator/raw.rs
Lines 87 to 94 in 7dfed90
Noticed that if init is called multiple times, the code will panic.
Probable fix is like:
Use compare_and_exchange
and only store the value when the slot.0
is null.
Hello
Can you explain why you think this is actually a bug? Calling init multiple times is invalid use and the crate doesn't use it that way. So why spend extra effort on supporting it?
I believe that while it would panic, that it still does not lead to UB or anything.