Lines Matching defs:aip
98 *copy_decode_addrinfo_dynamic(struct my_addrinfo *aip,
100 static void free_copied_addrinfo(struct my_addrinfo *aip);
456 copy_decode_addrinfo_dynamic(struct my_addrinfo *aip, idn_resconf_t idnctx)
460 if (aip == NULL)
463 newaip = malloc(sizeof(struct my_addrinfo) + aip->ai_addrlen);
467 *newaip = *aip;
469 memcpy(newaip->ai_addr, aip->ai_addr, aip->ai_addrlen);
472 newaip->ai_canonname = decode_name_dynamic(aip->ai_canonname,
475 newaip->ai_next = copy_decode_addrinfo_dynamic(aip->ai_next, idnctx);
480 free_copied_addrinfo(struct my_addrinfo *aip) {
481 while (aip != NULL) {
482 struct my_addrinfo *next = aip->ai_next;
484 if (aip->ai_canonname != NULL)
485 free(aip->ai_canonname);
486 free(aip);
487 aip = next;
497 struct my_addrinfo *aip;
516 err = _org_getaddrinfo(nodename, servname, hints, &aip);
517 if (err == 0 && aip != NULL) {
518 *res = copy_decode_addrinfo_dynamic(aip, encodeCtx);
523 if (aip != NULL)
524 _org_freeaddrinfo(aip);
533 freeaddrinfo(struct my_addrinfo *aip) {
534 TRACE("ENTER freeaddrinfo aip=%p\n", (void *)aip);
536 if (obj_islocked(aip)) {
540 obj_unlock(aip);
541 free_copied_addrinfo(aip);
547 _org_freeaddrinfo(aip);