Review Request 126508: kdesu: Fix fd leaks.

Michael Pyne mpyne at kde.org
Fri Dec 25 03:54:34 UTC 2015


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

(Updated Dec. 25, 2015, 3:54 a.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Frameworks.


Changes
-------

Submitted with commit a401ab0561cdea234bcbbfe89e567c758f6b9fe4 by Michael Pyne to branch master.


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/24b5eeda/attachment.html>


More information about the Kde-frameworks-devel mailing list