From: Charles Keepax Date: Fri, 25 Jan 2013 10:43:12 +0000 (+0000) Subject: compress: Return error when failing to allocate compress struct X-Git-Tag: v0.1.0~21 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=590afad;p=tinycompress.git compress: Return error when failing to allocate compress struct Signed-off-by: Charles Keepax Signed-off-by: Vinod Koul --- diff --git a/compress.c b/compress.c index 05e54ae..51455fc 100644 --- a/compress.c +++ b/compress.c @@ -207,8 +207,10 @@ struct compress *compress_open(unsigned int card, unsigned int device, int rc; compress = calloc(1, sizeof(struct compress)); - if (!compress || !config) + if (!compress || !config) { + oops(&bad_compress, errno, "cannot allocate compress object"); return &bad_compress; + } compress->config = config;