summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-08-08 22:05:43 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-08-08 23:13:47 +0900
commitdb7ed3dcddc6b824db83c6d2d5de162206d14293 (patch)
treeb92f881f828f13eb770ed4ca26bd5177bde1ef96 /src/lib/ecore_audio
parent4cf448274c631b6aa756ff6f83f355c41922e01a (diff)
ecore_audio_pulse_ml: Check memory allocation fail
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio_pulse_ml.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_pulse_ml.c b/src/lib/ecore_audio/ecore_audio_pulse_ml.c
index 19b652f..cc1a874 100644
--- a/src/lib/ecore_audio/ecore_audio_pulse_ml.c
+++ b/src/lib/ecore_audio/ecore_audio_pulse_ml.c
@@ -89,6 +89,12 @@ _ecore_pa_io_new(pa_mainloop_api *api, int fd, pa_io_event_flags_t flags, pa_io_
89 pa_io_event *event; 89 pa_io_event *event;
90 90
91 event = calloc(1, sizeof(pa_io_event)); 91 event = calloc(1, sizeof(pa_io_event));
92 if (!event)
93 {
94 ERR("Failed to allocate memory!");
95 return NULL;
96 }
97
92 event->mainloop = api; 98 event->mainloop = api;
93 event->userdata = userdata; 99 event->userdata = userdata;
94 event->callback = cb; 100 event->callback = cb;
@@ -176,6 +182,12 @@ _ecore_pa_time_new(pa_mainloop_api *api, const struct timeval *tv, pa_time_event
176 double interval; 182 double interval;
177 183
178 event = calloc(1, sizeof(pa_time_event)); 184 event = calloc(1, sizeof(pa_time_event));
185 if (!event)
186 {
187 ERR("Failed to allocate memory!");
188 return NULL;
189 }
190
179 event->mainloop = api; 191 event->mainloop = api;
180 event->userdata = userdata; 192 event->userdata = userdata;
181 event->callback = cb; 193 event->callback = cb;
@@ -263,6 +275,12 @@ _ecore_pa_defer_new(pa_mainloop_api *api, pa_defer_event_cb_t cb, void *userdata
263 pa_defer_event *event; 275 pa_defer_event *event;
264 276
265 event = calloc(1, sizeof(pa_defer_event)); 277 event = calloc(1, sizeof(pa_defer_event));
278 if (!event)
279 {
280 ERR("Failed to allocate memory!");
281 return NULL;
282 }
283
266 event->mainloop = api; 284 event->mainloop = api;
267 event->userdata = userdata; 285 event->userdata = userdata;
268 event->callback = cb; 286 event->callback = cb;