mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix segfault when no broadcast device is found
This commit is contained in:
parent
7ddeb2bf6d
commit
eb546db56b
|
@ -70,6 +70,10 @@ static uint32_t get_broadcast(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(sock);
|
close(sock);
|
||||||
|
if(sock_holder == NULL) {
|
||||||
|
perror("[!] no broadcast device found");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return sock_holder->sin_addr.s_addr;
|
return sock_holder->sin_addr.s_addr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user