$NetBSD: patch-aa,v 1.7 2009/05/12 13:58:44 obache Exp $ --- libxipc/sockutil.cc.orig 2009-01-05 18:30:56.000000000 +0000 +++ libxipc/sockutil.cc @@ -305,13 +305,13 @@ get_active_ipv4_addrs(vector& addr for ( ; ; ) { ifconf.ifc_len = ifnum * sizeof(struct ifreq); if (ifconf.ifc_buf != NULL) - delete[] ifconf.ifc_buf; - ifconf.ifc_buf = new char[ifconf.ifc_len]; + free(ifconf.ifc_buf); + ifconf.ifc_buf = (char *)malloc(ifconf.ifc_len); if (ioctl(s, SIOCGIFCONF, &ifconf) < 0) { // Check UNPv1, 2e, pp 435 for an explanation why we need this if ((errno != EINVAL) || (lastlen != 0)) { XLOG_ERROR("ioctl(SIOCGIFCONF) failed: %s", strerror(errno)); - delete[] ifconf.ifc_buf; + free(ifconf.ifc_buf); comm_close(s); return; } @@ -328,7 +328,7 @@ get_active_ipv4_addrs(vector& addr // vector buffer(ifconf.ifc_len); memcpy(&buffer[0], ifconf.ifc_buf, ifconf.ifc_len); - delete[] ifconf.ifc_buf; + free(ifconf.ifc_buf); // // Parse the interface information