Skip to content

Commit

Permalink
Merge pull request 86Box#4268 from Cacodemon345/patch-173
Browse files Browse the repository at this point in the history
net_modem.c: Fix memory leak
  • Loading branch information
OBattler authored Mar 14, 2024
2 parents b96b206 + 0ce889e commit 69a38ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/network/net_modem.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
Expand Down Expand Up @@ -323,9 +322,9 @@ process_tx_packet(modem_t *modem, uint8_t *p, uint32_t len)
buf[13] = 0x00;
memcpy(buf + 14, processed_tx_packet, received);
network_tx(modem->card, buf, received + 14);
free(processed_tx_packet);
free(buf);
}
free(processed_tx_packet);
return;
}

Expand Down Expand Up @@ -530,6 +529,7 @@ modem_enter_connected_state(modem_t* modem)
modem->connected = true;
modem->tcpIpMode = true;
modem->cooldown = true;
modem->tx_count = 0;
plat_netsocket_close(modem->serversocket);
modem->serversocket = -1;
memset(&modem->telClient, 0, sizeof(modem->telClient));
Expand Down

0 comments on commit 69a38ab

Please sign in to comment.