scoreboard.c: fix segfault

This commit is contained in:
wdlkmpx 2021-02-12 21:19:34 +08:00
parent 11fc1fb321
commit d54080fbed

View File

@ -98,6 +98,9 @@ gint read_score(struct score_board *b, struct score_board_full **bf, gint *nbf)
memset(b, 0, sizeof(struct score_board) * 10); memset(b, 0, sizeof(struct score_board) * 10);
if (!(fp = fopen(score_file, "r"))) { if (!(fp = fopen(score_file, "r"))) {
if (nbf) {
*nbf = 0;
}
g_free (score_file); g_free (score_file);
return TRUE; return TRUE;
} }