-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Labels
Description
it wasn't clear from the documentation... but uzlib_compress() allocates memory for out.outbuf
uzlib_compress() -> literal() -> zlib_literal() -> outbits() -> sresize()
it's odd that the comp.hash_table is allocated for uzlib by the app, but that uzlib allocates comp.out.outbuf on its own. it'd be cleaner if it was one or the other party doing the allocs.
I'd suggest this be documented (via the author's self documenting style) with a simple change to example/tgzip.c
comp.out.outbuf = malloc(0);
...
uzlib_compress(&comp, source, len);
...
free(comp.out.outbuf);
Reactions are currently unavailable