Skip to content
  • Clara Engler's avatar
    android: Use an `OwnedFd` to prevent leaks. · de2b05a0
    Clara Engler authored
    This commit wraps the `fd` of type `i32` to an `OwnedFd` in order to
    ensure that it gets properly dropped in both: success and error cases.
    
    Previously, it was already properly dropped if things got wrong during
    and after the `OnionTunnel::create_with_fd` call, but not beforehand.
    
    Now it gets wrapped around an `OwnedFd` in the first step, meaning that
    it will be properly closed in all cases.
    
    This commit also adjusts the function prototypes in the `onion-tunnel`
    crate respectively in order to accept higher level arguments of file
    descriptors.
    
    Fixes #116
    de2b05a0
Loading