Skip to content

Commit

Permalink
Merge pull request #281 from FppEpitech/fix/double-free-for-ai
Browse files Browse the repository at this point in the history
fix: double free when AI died
  • Loading branch information
AxelF44 authored Jun 23, 2024
2 parents 52e955d + fbcdcd5 commit ff92500
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions server/src/ai/die.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ void free_ai(app_t *app, ia_t *ai)

static void ia_die(app_t *app, ia_t *ai)
{
list_node_t *temp_command = ai->list_command->first;
list_node_t *temp_message = ai->list_messages->first;

while (temp_command) {
free(temp_command->data.command);
temp_command = temp_command->next;
}
while (temp_message) {
free(temp_message->data.message);
temp_message = temp_message->next;
}
ai->dead = true;
dead_response(ai);
pdi_command(app, ai->fd);
Expand Down

0 comments on commit ff92500

Please sign in to comment.