<!DOCTYPE qhelp PUBLIC
  "-//Semmle//qhelp//EN"
  "qhelp.dtd">
<qhelp>


<overview>
<p>
This rule looks at functions that return file or socket descriptors, but may return an error value before actually closing the resource.
This can occur when an operation performed on the open descriptor fails, and the function returns with an error before closing the open resource. An improperly handled error could cause the function to leak resource descriptors.
</p> 

<include src="dataFlowWarning.qhelp" />

</overview>
<recommendation>
<p>Ensure that the function frees all the resources it acquired when an error occurs.</p>

</recommendation>
<example>
<sample src="DescriptorMayNotBeClosed.cpp" />





</example>
</qhelp>
