aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-ringbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/alsa/alsa-ringbuf.c')
-rw-r--r--plugins/alsa/alsa-ringbuf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/alsa/alsa-ringbuf.c b/plugins/alsa/alsa-ringbuf.c
index 476222c..2dd1d0d 100644
--- a/plugins/alsa/alsa-ringbuf.c
+++ b/plugins/alsa/alsa-ringbuf.c
@@ -3,8 +3,14 @@
alsa_ringbuf_t * alsa_ringbuf_new(snd_pcm_uframes_t capacity, size_t frameSize) {
alsa_ringbuf_t * rb = malloc(sizeof(alsa_ringbuf_t));
+ if (!rb)
+ goto fail;
+
rb->rbuf = ringbuf_new(capacity*frameSize);
+ if (!rb->rbuf)
+ goto fail;
rb->frameSize = frameSize;
+fail:
return rb;
}