[PATCH 2/2] check memory allocation for calloc, die on failure

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri, 12 Aug 2016 13:09:36 +0200

---
 sent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sent.c b/sent.c
index df99ab4..b68b72e 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -211,7 +211,7 @@ ffload(Slide *s)
 	if (memcmp("farbfeld", hdr, 8))
 		die("sent: File '%s' has not a 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]);
 
-- 
2.9.2
--0n7NhiZb1XMLZLNc--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 12 2016 - 14:36:18 CEST