Daniel Stenberg <dan...@haxx.se> writes: > On Tue, 5 Oct 2010, Simon Josefsson wrote: > >> +LIBSSH2_API void >> +libssh2_free(void *ptr) >> +{ >> + free (ptr); >> +} > > I think it's too simple. For example, to be able to free the memory > returned by libssh2_base64_decode() it would have to use the internal > LIBSSH2_FREE() call which needs the session pointer (and will then use > the correct free callback).
Yeah, I thought about that, but kind of preferred the other way around to avoid the LIBSSH2_SESSION dependency. But I guess the library is already too deeply married into the LIBSSH2_SESSION parameter anyway that it doesn't make any sense to try and avoid it here. I can prepare an updated patch tomorrow.. /Simon > Thus it would need to be something like: > > LIBSSH2_API void > libssh2_free(LIBSSH2_SESSION *session, void *ptr) > { > LIBSSH2_FREE(session, ptr); > } _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel