From 1b332a44a0950e4ed6b45e08d4cc5a7d9a5d8c77 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 29 Jun 2016 16:11:37 -0700 Subject: [PATCH] sio_sine example: check memory allocation --- example/sio_sine.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/example/sio_sine.c b/example/sio_sine.c index 562fce0..75fe613 100644 --- a/example/sio_sine.c +++ b/example/sio_sine.c @@ -209,6 +209,11 @@ int main(int argc, char **argv) { } struct SoundIoOutStream *outstream = soundio_outstream_create(device); + if (!outstream) { + fprintf(stderr, "out of memory\n"); + return 1; + } + outstream->write_callback = write_callback; outstream->underflow_callback = underflow_callback; outstream->name = stream_name;