Review Request 126410: Fix FILE* leak in kwalletd

Michael Pyne mpyne at kde.org
Fri Dec 18 22:50:57 UTC 2015


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

(Updated Dec. 18, 2015, 10:50 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Frameworks, Martin Klapetek and Valentin Rusu.


Changes
-------

Submitted with commit 1d0bec904dd78ff21d1d68e9c3e363ad1a77f7ed by Michael Pyne to branch master.


Repository: kwallet


Description
-------

Fix a leak of a `FILE*` in kwalletd, spotted by Coverity (CID 1335090), and a couple of minor fixes/cleanups since I was there.

1. No need to memset a `char[]`, you can let compiler default-initialize it (and likely even be able to move the whole array into .bss).
2. The chop after `fgets` can easily be confused for a null terminator check, and `fgets` isn't required to return a newline anyways, so add sanity checking (which helps document better at the same time).


Diffs
-----

  src/runtime/kwalletd/main.cpp db8d55c 

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


Testing
-------

Everything compiles. Not much beyond done.


Thanks,

Michael Pyne

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


More information about the Kde-frameworks-devel mailing list