--- libelwix/example/test_n2.c 2016/05/14 13:12:43 1.3.48.2 +++ libelwix/example/test_n2.c 2016/05/14 13:19:18 1.3.48.3 @@ -12,8 +12,9 @@ main(int argc, char **argv) struct in_addr a; netaddr_t n, *n0; inaddr_t t; - ether_addr_t ea; + ether_addr_t *ea; char str[BUFSIZ]; + int res; a.s_addr = E_CIDRMASK(8); printf("/8 = %08X %08x\n", a.s_addr, htonl(a.s_addr)); @@ -83,8 +84,10 @@ main(int argc, char **argv) val = ait_allocVar(); AIT_SET_STR(val, argv[2]); - if (!e_ether_addr(AIT_GET_STR(val), &ea)) - printf("MAC address of iface=%s is %s\n", AIT_GET_STR(val), e_ether_ntoa(&ea, str, sizeof str)); + if ((ea = e_ether_addr(AIT_GET_STR(val), NULL))) { + printf("MAC address of iface=%s is %s\n", AIT_GET_STR(val), e_ether_ntoa(ea, str, sizeof str)); + e_free(ea); + } ait_freeVar(&val); return 0;