summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-15 17:31:25 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-09-18 10:55:27 +0000
commit29d64bc8e06d6809ac0c68b7b5459a8a51667769 (patch)
tree36f42b943be5365cd1f7ce27d2e7c820697da28b /examples
parent76adb6c29f9284a3d7cceb8fb09c3bb7c4cd5e1b (diff)
QEvdevKeyboardHandler: use RAII in create()/ctor
Coverity somewhat rightfully complained that the FD may be leaked in certain cases, e.g. when the new-expression throws. Yes, the plugin is compiled with exceptions disabled, but the code is still a bug waiting to happen, because it's too easy to just add an early return to the function and leak the FD that way. Fix by writing a small RAII class for FDs (can't use QSharedPointer, since it's not a pointer we're dealing with). It's quite generically named, in anticipation that it might come in handy elsewhere, too. Coverity-Id: 89046 Change-Id: I83d1ed3f11219065d2248c129ed191a651f617c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions