mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-27 06:14:09 +00:00
raw.c: Avoid NULL pointer dereference
This commit is contained in:
parent
f9ce31f98b
commit
e89b48d23f
@ -434,8 +434,10 @@ raw_new_ip6(u8_t proto)
|
||||
struct raw_pcb *pcb;
|
||||
pcb = raw_new(proto);
|
||||
#if LWIP_IPV4
|
||||
IP_SET_TYPE_VAL(pcb->local_ip, IPADDR_TYPE_V6);
|
||||
IP_SET_TYPE_VAL(pcb->remote_ip, IPADDR_TYPE_V6);
|
||||
if(pcb != NULL) {
|
||||
IP_SET_TYPE_VAL(pcb->local_ip, IPADDR_TYPE_V6);
|
||||
IP_SET_TYPE_VAL(pcb->remote_ip, IPADDR_TYPE_V6);
|
||||
}
|
||||
#endif /* LWIP_IPV4 */
|
||||
return pcb;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user