summaryrefslogtreecommitdiff
path: root/src/lib/emotion/emotion_webcam.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-15 11:29:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-15 11:31:28 +0900
commit6d5058ee1c4a4061b25c91549c54fd53641a861c (patch)
tree3ea41b737a6864b2d08c603e4b1f1e54b5ff395e /src/lib/emotion/emotion_webcam.c
parent5dfe3789f225308069d4593e99cf38145601beb6 (diff)
emotion - webcam - don't access after free and ensure it is not in list
this should fix CID 1137853 and CID 1137854
Diffstat (limited to '')
-rw-r--r--src/lib/emotion/emotion_webcam.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c
index 04756cbeda..3cf11b2d24 100644
--- a/src/lib/emotion/emotion_webcam.c
+++ b/src/lib/emotion/emotion_webcam.c
@@ -138,6 +138,7 @@ _emotion_check_device(Emotion_Webcam *ew)
138 on_error: 138 on_error:
139#endif 139#endif
140 INF("'%s' is not a webcam ['%s']", ew->name, strerror(errno)); 140 INF("'%s' is not a webcam ['%s']", ew->name, strerror(errno));
141 _emotion_webcams->webcams = eina_list_remove(_emotion_webcams->webcams, ew);
141 eina_stringshare_del(ew->syspath); 142 eina_stringshare_del(ew->syspath);
142 eina_stringshare_del(ew->device); 143 eina_stringshare_del(ew->device);
143 eina_stringshare_del(ew->name); 144 eina_stringshare_del(ew->name);
@@ -211,8 +212,6 @@ _emotion_process_webcam(void *data)
211 { 212 {
212 if (_emotion_check_device(test)) 213 if (_emotion_check_device(test))
213 ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL); 214 ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL);
214 else
215 _emotion_webcam_remove_cb(test, NULL);
216 } 215 }
217 216
218 eina_stringshare_del(syspath); 217 eina_stringshare_del(syspath);
@@ -263,8 +262,6 @@ _emotion_eeze_events(const char *syspath,
263 { 262 {
264 if (_emotion_check_device(test)) 263 if (_emotion_check_device(test))
265 ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL); 264 ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL);
266 else
267 _emotion_webcam_remove_cb(test, NULL);
268 } 265 }
269 } 266 }
270 ecore_event_add(EMOTION_WEBCAM_UPDATE, NULL, NULL, NULL); 267 ecore_event_add(EMOTION_WEBCAM_UPDATE, NULL, NULL, NULL);