diff options
-rw-r--r-- | src/worker.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/worker.c b/src/worker.c index 51640e8..7d2448b 100644 --- a/src/worker.c +++ b/src/worker.c @@ -42,7 +42,12 @@ worker_func(void* data) uint32_t size = 0; jack_ringbuffer_read(jalv->worker.requests, (char*)&size, sizeof(size)); - buf = realloc(buf, size); + if (!(buf = realloc(buf, size))) { + fprintf(stderr, "error: realloc() failed\n"); + free(buf); + return NULL; + } + jack_ringbuffer_read(jalv->worker.requests, buf, size); jalv->worker.iface->work( |