From faf295a6b4e7a09ae9214bf1ec4df2062b6a47ee Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 11 Jan 2012 16:20:17 +0100 Subject: [PATCH] Fix re-allocation of PGN-cache memory It allocated 8 times too much! --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index 4c05a05..636a1a5 100644 --- a/backend.c +++ b/backend.c @@ -11218,7 +11218,7 @@ PackGame (Board board) if(movePtr > dataSize) { if(appData.debugMode) fprintf(debugFP, "move-cache overflow, enlarge to %d MB\n", dataSize/128); dataSize *= 8; // increase size by factor 8 (512KB -> 4MB -> 32MB -> 256MB -> 2GB) - if(dataSize) newSpace = (Move*) calloc(8*dataSize + 1000, sizeof(Move)); + if(dataSize) newSpace = (Move*) calloc(dataSize + 1000, sizeof(Move)); if(newSpace) { int i; Move *p = moveDatabase, *q = newSpace; -- 1.7.0.4