Free()ing addresses returned from krb5_auth_con_getaddrs()
Ken Hornstein
kenh at cmf.nrl.navy.mil
Thu Apr 1 17:19:05 EST 2004
Howdy,
I've been working on directional address support, and in adding this
support to the demo apps, I've found I need to call
krb5_auth_con_getaddrs() (long story).
Of course, I want to free this data (even though it's not technically
necessary for the "simple" demo app). However, I've run into a bit
of a problem ... it seems the API I need to use is marked "private".
Specifically, krb5_auth_con_getaddrs() (a public function) returns
internally malloc'd krb5_address structures. The logical function to
use would be krb5_free_address(), but that is marked with KRB5_PRIVATE
in the latest release. I can't use krb5_free_addresses(), since that's
designed to free an array of krb5_address structures, and I've only got
a single krb5_address structure.
The only reasonable solution I can come up with is to put
krb5_free_address back on the export list in the long term (in the
short term, for the simple app, it's not a big deal, since I can just
#define KRB5_PRIVATE, but I think it's reasonable to fix this since
other programs may want to use this API). Is there another possible
solution?
--Ken
More information about the krbdev
mailing list