Commit 26dc8a5
authored
Check if ai_list is null before freeing it (#831)
Passing null to freeaddrinfo is undefined behaviour. While glibc and uClibc both handle it safely,
musl does not, so a bad nodename or servname causes a segfault.
This change ensures that the ai_list is non-null before trying to free it. In musl and glibc this
condition will never be met, but there are some paths for it to be met in uClibc.1 parent b2b37ef commit 26dc8a5
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
697 | 699 | | |
698 | 700 | | |
699 | 701 | | |
| |||
0 commit comments