diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2017-10-11 18:46:55 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2017-10-22 19:23:05 +0200 |
commit | e67c171035807f547ae2eeb7359d7ec8d158cc2a (patch) | |
tree | 4a805d933f4200d7e8cf1901811eee51b243d46a /src/common | |
parent | f7476bce41c8efbfc8239c2c239e5a2cee8a7bcf (diff) |
SDR: Minor fixes in error condition handling
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/sdr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/sdr.c b/src/common/sdr.c index 2e40833..c2684e3 100644 --- a/src/common/sdr.c +++ b/src/common/sdr.c @@ -147,12 +147,12 @@ void *sdr_open(const char __attribute__((__unused__)) *audiodev, double *tx_freq sdr->thread_read.buffer = calloc(sdr->thread_read.buffer_size, sizeof(*sdr->thread_read.buffer)); if (!sdr->thread_read.buffer) { PDEBUG(DSDR, DEBUG_ERROR, "No mem!\n"); - return NULL; + goto error; } sdr->thread_read.buffer2 = calloc(sdr->thread_read.buffer_size, sizeof(*sdr->thread_read.buffer2)); if (!sdr->thread_read.buffer2) { PDEBUG(DSDR, DEBUG_ERROR, "No mem!\n"); - return NULL; + goto error; } sdr->thread_read.in = sdr->thread_read.out = 0; if (oversample > 1) { @@ -164,12 +164,12 @@ void *sdr_open(const char __attribute__((__unused__)) *audiodev, double *tx_freq sdr->thread_write.buffer = calloc(sdr->thread_write.buffer_size, sizeof(*sdr->thread_write.buffer)); if (!sdr->thread_write.buffer) { PDEBUG(DSDR, DEBUG_ERROR, "No mem!\n"); - return NULL; + goto error; } sdr->thread_write.buffer2 = calloc(sdr->thread_write.buffer_size * sdr->oversample, sizeof(*sdr->thread_write.buffer2)); if (!sdr->thread_write.buffer2) { PDEBUG(DSDR, DEBUG_ERROR, "No mem!\n"); - return NULL; + goto error; } sdr->thread_write.in = sdr->thread_write.out = 0; if (oversample > 1) { |