diff --git a/l2tpns.c b/l2tpns.c index 2eb39bf..8bbe46c 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -2705,6 +2705,8 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu { LOG(1, s, t, "Invalid length in AVP\n"); STAT(tunnel_rx_errors); + free(sendchalresponse); + free(recvchalresponse); return; } p += n; // next @@ -3250,6 +3252,8 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu controladd(c, asession, t); // send the message } + free(sendchalresponse); + free(recvchalresponse); return; case 11: // ICRP LOG(3, s, t, "Received ICRP\n"); @@ -3304,8 +3308,8 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu LOG(1, s, t, "Unknown message type %u\n", message); break; } - if (sendchalresponse) free(sendchalresponse); - if (recvchalresponse) free(recvchalresponse); + free(sendchalresponse); + free(recvchalresponse); cluster_send_tunnel(t); } else