Merge pull request #149 from iosen/sntp-pbuf-free

sntp: free the pbuf after sending the request
This commit is contained in:
Angus Gratton 2016-06-28 17:10:01 +10:00 committed by GitHub
commit 15964efc0f

View file

@ -608,6 +608,8 @@ sntp_send_request(ip_addr_t *server_addr)
sntp_initialize_request(sntpmsg); sntp_initialize_request(sntpmsg);
/* send request */ /* send request */
udp_sendto(sntp_pcb, p, server_addr, SNTP_PORT); udp_sendto(sntp_pcb, p, server_addr, SNTP_PORT);
pbuf_free(p);
/* set up receive timeout: try next server or retry on timeout */ /* set up receive timeout: try next server or retry on timeout */
sys_timeout((u32_t)SNTP_RECV_TIMEOUT, sntp_try_next_server, NULL); sys_timeout((u32_t)SNTP_RECV_TIMEOUT, sntp_try_next_server, NULL);
#if SNTP_CHECK_RESPONSE >= 1 #if SNTP_CHECK_RESPONSE >= 1