Review Request 126508: kdesu: Fix fd leaks.

Michael Pyne mpyne at kde.org
Fri Dec 25 00:19:02 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126508/
-----------------------------------------------------------

Review request for KDE Frameworks.


Repository: kdesu


Description
-------

Don't leak fd when creating socket.

Coverity notes (CID 1289177) that we leak the fd for our socket in
pretty much every error handling path.

Rather than laboriously add close(fd) calls everywhere I instead added a
scope guard (and turned it off at the 'successful return' part).


Diffs
-----

  src/kdesud/kdesud.cpp f991727 

Diff: https://git.reviewboard.kde.org/r/126508/diff/


Testing
-------

Builds but I'm not sure what even still uses kdesu in 2015...


Thanks,

Michael Pyne

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151225/ca9cf062/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list