summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2013-12-13 12:22:06 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-12-13 12:22:06 +0900
commit96c1d15ac04195a2fbee17294aae5a0ac3a3e1a1 (patch)
treee02eadb1b6bb39c1b5ebd023d053e0be078eb154
parentf6c4513da47945eeeea3283fa66eefd388d0e079 (diff)
emotion: fix potential memory leak when webcam register fail.
-rw-r--r--src/lib/emotion/emotion_webcam.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c
index 49992c30f..974a9a8ca 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);
}