mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-29 08:21:18 +01:00
net/gnrc/udp: Adding Null pointer check in gnrc_netif_hdr_build
This commit is contained in:
parent
11b4bab101
commit
f583368842
@ -138,6 +138,11 @@ static void send(char *addr_str, char *port_str, char *data_len_str, unsigned in
|
||||
if (iface > 0) {
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
|
||||
if(netif == NULL) {
|
||||
puts("Error: unable to allocate NETIF header");
|
||||
gnrc_pktbuf_release(ip);
|
||||
return;
|
||||
}
|
||||
((gnrc_netif_hdr_t *)netif->data)->if_pid = (kernel_pid_t)iface;
|
||||
LL_PREPEND(ip, netif);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user