Darren Reed writes: > As part of this continuing code review, I looked at > http://cr.opensolaris.org/~tonyn/firewall13Jan2009/usr/src/cmd/svc/servinfo/servinfo.c > > and I'm wondering if you have, in your latest workspace, a version > of uaddr2port() that doesn't leak memory from the malloc() for port_str? > The other alternative is to use alloca() instead.
I doubt that either malloc or alloca is needed here. strtol should be able to crack those numbers without having to make a separate copy. -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677