mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1026774: Return errors on some rare failure cases in stun_get_mib_addrs. r=mt
This commit is contained in:
parent
d731dc2940
commit
462f51ddbd
@ -239,12 +239,21 @@ stun_get_mib_addrs(nr_local_addr addrs[], int maxaddrs, int *count)
|
||||
mib[4] = NET_RT_IFLIST;
|
||||
mib[5] = 0;
|
||||
|
||||
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
|
||||
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) {
|
||||
errx(1, "iflist-sysctl-estimate");
|
||||
if ((buf = malloc(needed)) == NULL)
|
||||
ABORT(R_INTERNAL);
|
||||
}
|
||||
|
||||
if ((buf = malloc(needed)) == NULL) {
|
||||
errx(1, "malloc");
|
||||
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
|
||||
ABORT(R_NO_MEMORY);
|
||||
}
|
||||
|
||||
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
|
||||
errx(1, "actual retrieval of interface table");
|
||||
ABORT(R_INTERNAL);
|
||||
}
|
||||
|
||||
lim = buf + needed;
|
||||
|
||||
next = buf;
|
||||
|
Loading…
Reference in New Issue
Block a user