cedric pushed a commit to branch efl-1.8. http://git.enlightenment.org/core/efl.git/commit/?id=c5c1ee243bf15a9ace1e7a50d346c2bb39620079
commit c5c1ee243bf15a9ace1e7a50d346c2bb39620079 Author: Cedric BAIL <cedric.b...@samsung.com> Date: Fri Dec 13 12:22:06 2013 +0900 emotion: fix potential memory leak when webcam register fail. --- src/lib/emotion/emotion_webcam.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c index 49992c3..974a9a8 100644 --- a/src/lib/emotion/emotion_webcam.c +++ b/src/lib/emotion/emotion_webcam.c @@ -226,8 +226,13 @@ _emotion_eeze_events(const char *syspath, Emotion_Webcam *test; test = _emotion_webcam_new(syspath); - if ((test) && (_emotion_check_device(test))) - ecore_event_add(EMOTION_WEBCAM_ADD, test, NULL, NULL); + if (test) + { + 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); } --