From 2fe1eaeea6103c89080d57e09276f118d0cb8cbb Mon Sep 17 00:00:00 2001 From: WAPEETY Date: Tue, 14 Jun 2022 18:59:01 +0200 Subject: [PATCH] Risolto memory leak FINALMENTE (issue #18) --- src/multiplayer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/multiplayer.c b/src/multiplayer.c index 03e0ea1..739962d 100644 --- a/src/multiplayer.c +++ b/src/multiplayer.c @@ -64,8 +64,8 @@ void pvp_new_game(){ pointboard_t *points; - char *nickname1 = (char*) malloc(sizeof(char) * 16); //PERCHË TU CAUSI UN MEMORY LEAK (bravo copilot che commenta al posto mio) - char *nickname2 = (char*) malloc(sizeof(char) * 16); + char *nickname1; + char *nickname2; nickname1 = form(16, " Nome 1: "); refresh(); @@ -493,6 +493,7 @@ void pve_end_game(int win_flag,gamefield_t **gameFields, tetrimini_pool_t *pool, wrefresh(summary); free_player(players[0]); + free_player(players[1]); free(players); free_gamefield(gameFields[0]); free_gamefield(gameFields[1]);