summaryrefslogtreecommitdiff
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
parent5dfe3789f225308069d4593e99cf38145601beb6 (diff)
emotion - webcam - don't access after free and ensure it is not in list
this should fix CID 1137853 and CID 1137854
-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 04756cbed..3cf11b2d2 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)
on_error:
#endif
INF("'%s' is not a webcam ['%s']", ew->name, strerror(errno));
+ _emotion_webcams->webcams = eina_list_remove(_emotion_webcams->webcams, ew);
eina_stringshare_del(ew->syspath);
eina_stringshare_del(ew->device);
eina_stringshare_del(ew->name);
@@ -211,8 +212,6 @@ _emotion_process_webcam(void *data)
{
if (_emotion_check_device(test))
ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL);
- else
- _emotion_webcam_remove_cb(test, NULL);
}
eina_stringshare_del(syspath);
@@ -263,8 +262,6 @@ _emotion_eeze_events(const char *syspath,
{
if (_emotion_check_device(test))
ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL);
- else
- _emotion_webcam_remove_cb(test, NULL);
}
}
ecore_event_add(EMOTION_WEBCAM_UPDATE, NULL, NULL, NULL);