summaryrefslogtreecommitdiff
path: root/src/lib/emotion/emotion_webcam.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-07-09 13:28:37 +0100
committerChris Michael <cp.michael@samsung.com>2013-07-09 13:29:32 +0100
commit5f3a2dd5f6bd2cfb9e25e12535b692fff1cdb009 (patch)
tree0d0bd4272fd1e667cd77daef0af24f23d42747a5 /src/lib/emotion/emotion_webcam.c
parent6ceabbdb6cfeabc02c0bd16f08218543bf0a1d73 (diff)
Don't leak fd handles (ie: leave files open) when checking devices
NB: Fixes Coverity CID1039175 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/emotion/emotion_webcam.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c
index 1f74a7d3aa..9b6d502099 100644
--- a/src/lib/emotion/emotion_webcam.c
+++ b/src/lib/emotion/emotion_webcam.c
@@ -122,6 +122,8 @@ _emotion_check_device(Emotion_Webcam *ew)
122 122
123 EINA_REFCOUNT_INIT(ew); 123 EINA_REFCOUNT_INIT(ew);
124 124
125 if (fd > 0) close(fd);
126
125 return; 127 return;
126 128
127 on_error: 129 on_error:
@@ -131,6 +133,7 @@ _emotion_check_device(Emotion_Webcam *ew)
131 eina_stringshare_del(ew->device); 133 eina_stringshare_del(ew->device);
132 eina_stringshare_del(ew->name); 134 eina_stringshare_del(ew->name);
133 free(ew); 135 free(ew);
136 if (fd > 0) close(fd);
134} 137}
135 138
136static Emotion_Webcam * 139static Emotion_Webcam *