sntp: free the pbuf after sending the request
Fixes a memory leak.
This commit is contained in:
		
							parent
							
								
									26dd3f1c79
								
							
						
					
					
						commit
						37180024f4
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -608,6 +608,8 @@ sntp_send_request(ip_addr_t *server_addr)
 | 
			
		|||
    sntp_initialize_request(sntpmsg);
 | 
			
		||||
    /* send request */
 | 
			
		||||
    udp_sendto(sntp_pcb, p, server_addr, SNTP_PORT);
 | 
			
		||||
    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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue