it* My version of sent Err codevoid.de 70 i Err codevoid.de 70 hgit clone git://git.codevoid.de/sent-sdk.git URL:git://git.codevoid.de/sent-sdk.git codevoid.de 70 1Log /git/sent-sdk/log.gph codevoid.de 70 1Files /git/sent-sdk/files.gph codevoid.de 70 1Refs /git/sent-sdk/refs.gph codevoid.de 70 1README /git/sent-sdk/file/README.md.gph codevoid.de 70 1LICENSE /git/sent-sdk/file/LICENSE.gph codevoid.de 70 i--- Err codevoid.de 70 1commit 0ff43aaf341e89086fea10605021fb4a94c835ad /git/sent-sdk/commit/0ff43aaf341e89086fea10605021fb4a94c835ad.gph codevoid.de 70 1parent ca7978c59bb30a095cf8279944d3ec78361afd30 /git/sent-sdk/commit/ca7978c59bb30a095cf8279944d3ec78361afd30.gph codevoid.de 70 hAuthor: Markus Teich URL:mailto:markus.teich@stusta.mhn.de codevoid.de 70 iDate: Fri, 4 Nov 2016 19:50:09 +0100 Err codevoid.de 70 i Err codevoid.de 70 ireplace malloc() with ecalloc() Err codevoid.de 70 i Err codevoid.de 70 iDiffstat: Err codevoid.de 70 i M sent.c | 14 ++++---------- Err codevoid.de 70 i Err codevoid.de 70 i1 file changed, 4 insertions(+), 10 deletions(-) Err codevoid.de 70 i--- Err codevoid.de 70 1diff --git a/sent.c b/sent.c /git/sent-sdk/file/sent.c.gph codevoid.de 70 it@@ -217,14 +217,11 @@ ffload(Slide *s) Err codevoid.de 70 i if (s->img->buf) Err codevoid.de 70 i free(s->img->buf); Err codevoid.de 70 i /* internally the image is stored in 888 format */ Err codevoid.de 70 i- if (!(s->img->buf = malloc(3 * s->img->bufwidth * s->img->bufheight))) Err codevoid.de 70 i- die("sent: Unable to allocate buffer for image:"); Err codevoid.de 70 i+ s->img->buf = ecalloc(s->img->bufwidth * s->img->bufheight, strlen("888")); Err codevoid.de 70 i Err codevoid.de 70 i /* scratch buffer to read row by row */ Err codevoid.de 70 i rowlen = s->img->bufwidth * 2 * strlen("RGBA"); Err codevoid.de 70 i- row = malloc(rowlen); Err codevoid.de 70 i- if (!row) Err codevoid.de 70 i- die("sent: Unable to allocate buffer for image row:"); Err codevoid.de 70 i+ row = ecalloc(1, rowlen); Err codevoid.de 70 i Err codevoid.de 70 i /* extract window background color channels for transparency */ Err codevoid.de 70 i bg_r = (sc[ColBg].pixel >> 16) % 256; Err codevoid.de 70 it@@ -275,9 +272,7 @@ ffprepare(Image *img) Err codevoid.de 70 i NULL, width, height, 32, 0))) Err codevoid.de 70 i die("sent: Unable to create XImage"); Err codevoid.de 70 i Err codevoid.de 70 i- if (!(img->ximg->data = malloc(img->ximg->bytes_per_line * height))) Err codevoid.de 70 i- die("sent: Unable to allocate data section for XImage"); Err codevoid.de 70 i- Err codevoid.de 70 i+ img->ximg->data = ecalloc(height, img->ximg->bytes_per_line); Err codevoid.de 70 i if (!XInitImage(img->ximg)) Err codevoid.de 70 i die("sent: Unable to initiate XImage"); Err codevoid.de 70 i Err codevoid.de 70 it@@ -583,8 +578,7 @@ xloadfonts() Err codevoid.de 70 i char *fstrs[LEN(fontfallbacks)]; Err codevoid.de 70 i Err codevoid.de 70 i for (j = 0; j < LEN(fontfallbacks); j++) { Err codevoid.de 70 i- if (!(fstrs[j] = malloc(MAXFONTSTRLEN))) Err codevoid.de 70 i- die("sent: Unable to allocate fontstring:"); Err codevoid.de 70 i+ fstrs[j] = ecalloc(1, MAXFONTSTRLEN); Err codevoid.de 70 i } Err codevoid.de 70 i Err codevoid.de 70 i for (i = 0; i < NUMFONTSCALES; i++) { Err codevoid.de 70 .