sustrik / libdill

Structured concurrency in C
MIT License
1.68k stars 156 forks source link

fix free() logic in dill_http_hclose(), only free if malloc'd #163

Closed jadeblaquiere closed 5 years ago

jadeblaquiere commented 5 years ago

dill_http_attach allocates memory with obj = malloc(), however the logic was reversed in dill_http_hclose such that allocated memory would not be freed (or worse still, if dill_http_attach_mem was called to attach then on dill_http_hclose free would be called referencing memory that had not been allocated).

jadeblaquiere commented 5 years ago

This patch is licensed under the terms of the MIT/X11 License.