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) {