diff options
author | Simon Rettberg | 2019-07-11 15:17:37 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-11 15:17:37 +0200 |
commit | b8152cf67ad0995d34debbedcc374da46e3b217c (patch) | |
tree | da7759ddfcb0a49eae932d3d0fee1346892bcd0b | |
parent | Slightly more consistent naming (diff) | |
download | idle-daemon-b8152cf67ad0995d34debbedcc374da46e3b217c.tar.gz idle-daemon-b8152cf67ad0995d34debbedcc374da46e3b217c.tar.xz idle-daemon-b8152cf67ad0995d34debbedcc374da46e3b217c.zip |
Fix fd leak
-rw-r--r-- | src/rpc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -91,8 +91,10 @@ void rpc_handle( int listenFd ) close( fd ); // TODO: Allow more for root (eg. cancel reboot/poweroff) continue; } - if ( ! doublefork() ) + if ( ! doublefork() ) { + close( fd ); continue; // Parent continues + } handleClient( fd, &ucred ); exit( 0 ); } |