We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a703ee7 commit 9e07edfCopy full SHA for 9e07edf
system/lib/libc/musl/src/network/freeaddrinfo.c
@@ -6,11 +6,19 @@
6
7
void freeaddrinfo(struct addrinfo *p)
8
{
9
+#if __EMSCRIPTEN__
10
+ // Emscripten's usage of this structure is very simple: we always allocate
11
+ // ai_addr, and do not use the linked list aspect at all. There is also no
12
+ // aliasing with aibuf.
13
+ free(p->ai_addr);
14
+ free(p);
15
+#else
16
size_t cnt;
17
for (cnt=1; p->ai_next; cnt++, p=p->ai_next);
18
struct aibuf *b = (void *)((char *)p - offsetof(struct aibuf, ai));
19
b -= b->slot;
20
LOCK(b->lock);
21
if (!(b->ref -= cnt)) free(b);
22
else UNLOCK(b->lock);
23
+#endif
24
}
0 commit comments