stefan pushed a commit to branch master.

commit d54bfd7e1db66a7cc8b57669257dcfaf98ab95af
Author: Stefan Schmidt <[email protected]>
Date:   Thu Sep 12 15:24:32 2013 +0100

    emotion: Avoid leak by also checking for fd being null.
    
    If fd would be null here we would leak the fd handle. Fix the check.
    
    CID: 1039175
---
 src/lib/emotion/emotion_webcam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c
index a0f81c7..52e6b5b 100644
--- a/src/lib/emotion/emotion_webcam.c
+++ b/src/lib/emotion/emotion_webcam.c
@@ -123,7 +123,7 @@ _emotion_check_device(Emotion_Webcam *ew)
 
    EINA_REFCOUNT_INIT(ew);
 
-   if (fd > 0) close(fd);
+   if (fd >= 0) close(fd);
 
    return;
 

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

Reply via email to