[Date Prev][Date Next]
Re: where has ber_bvdup() gone?
On Sat, Jan 05, 2002 at 02:24:28PM -0800, Howard Chu wrote:
> Strings returned from liblber ought to be parsed in place in the existing Ber
> buffer; just return the pointer and length. Then you don't even need a
> ber_bvfree() function because there is no alloc to clean up.
> There are plenty of other libraries out there defined this way - memory given
> to you by the library is the library's responsibility to clean up, not yours.
It's also bad how old code written for the RFC 1823 API seemingly works
with the new, but in reality has memory leaks due to the new requirements
to free ber structures.
> Thanks for fixing things up with the replacement ber_bvdup function. We should
> not break binary compatibility, even if the existing spec is ill-conceived and
Yes, I think we should stick to that API, at least until a draft for a
better one exists. Right now the draft at least documents our API. A
new API might make it harder to write apps that work with multiple
vendor implementations. I still think a new API is a good idea though,
and we also need something that can become a standard.