From 74a1ee5a39a5f654c1ab956d3b3b64302025b201 Mon Sep 17 00:00:00 2001 From: Thomas Flouris Date: Wed, 12 Jul 2017 15:31:16 +0100 Subject: [PATCH] fixed another issue with site compression memory allocation --- src/compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compress.c b/src/compress.c index a02ec84..fea4413 100644 --- a/src/compress.c +++ b/src/compress.c @@ -188,8 +188,8 @@ PLL_EXPORT unsigned int * pll_compress_site_patterns(char ** sequence, } /* allocate memory for the alignment */ - memptr = column[0] = (char *)malloc((size_t)((*length)+1) * - (size_t)count * + memptr = column[0] = (char *)malloc((size_t)(*length) * + (size_t)(count+1) * sizeof(char)); if (!memptr) {