Skip to content

Commit

Permalink
Risolto memory leak FINALMENTE (issue #18)
Browse files Browse the repository at this point in the history
  • Loading branch information
WAPEETY committed Jun 14, 2022
1 parent a8a73cc commit 2fe1eae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/multiplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit 2fe1eae

Please sign in to comment.