From 82031caa3cff90f017698f1a90b29ad978038db5 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 1 Sep 2011 21:08:11 +0200 Subject: [PATCH] Fixed bug #34170 Memory leak in sntp_send_request() (pbuf used for request was sent to udp but never freed) --- apps/sntp/sntp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/sntp/sntp.c b/apps/sntp/sntp.c index eaaeecd..eb999bb 100644 --- a/apps/sntp/sntp.c +++ b/apps/sntp/sntp.c @@ -604,6 +604,8 @@ sntp_send_request(ip_addr_t *server_addr) sntp_initialize_request(sntpmsg); /* send request */ udp_sendto(sntp_pcb, p, server_addr, SNTP_PORT); + /* free the pbuf after sending it */ + pbuf_free(p); /* set up receive timeout: try next server or retry on timeout */ sys_timeout((u32_t)SNTP_RECV_TIMEOUT, sntp_try_next_server, NULL); #if SNTP_CHECK_RESPONSE >= 1