summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib-src/update-game-score.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 55737c542d7..2a699b2550d 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -357,7 +357,9 @@ read_scores (filename, scores, count)
scorecount++;
if (scorecount >= cursize)
{
- ret = (struct score_entry *) realloc (ret, cursize *= 2);
+ cursize *= 2;
+ ret = (struct score_entry *)
+ realloc (ret, (sizeof (struct score_entry) * cursize));
if (!ret)
return -1;
}