check memory allocation for calloc, die on failure
authorHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 12 Aug 2016 11:09:36 +0000 (13:09 +0200)
committerMarkus Teich <markus.teich@stusta.mhn.de>
Mon, 10 Oct 2016 18:51:15 +0000 (20:51 +0200)
sent.c

diff --git a/sent.c b/sent.c
index 82acd81c5e5809a8f79dd2dfbf248910c32cfc3d..5fce290990f693c9f6219ee6b913b3892c652adf 100644 (file)
--- a/sent.c
+++ b/sent.c
@@ -210,7 +210,7 @@ ffload(Slide *s)
        if (memcmp("farbfeld", hdr, 8))
                die("sent: Filtered file '%s' has no valid farbfeld header", filename);
 
-       s->img = calloc(1, sizeof(Image));
+       s->img = ecalloc(1, sizeof(Image));
        s->img->bufwidth = ntohl(*(uint32_t *)&hdr[8]);
        s->img->bufheight = ntohl(*(uint32_t *)&hdr[12]);