X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=phpstr%2Fphpstr.c;fp=phpstr%2Fphpstr.c;h=45c9e2632bb6293a10765d59f6dd941e598b4335;hp=f9ae25c41440d8817bcd01028c69999993b6cbc2;hb=3f97cec39ebeae3bdafc082d310e878f995b04e8;hpb=6be753a288ed7a42e0cd19551d85eb8eb14c4566 diff --git a/phpstr/phpstr.c b/phpstr/phpstr.c index f9ae25c..45c9e26 100644 --- a/phpstr/phpstr.c +++ b/phpstr/phpstr.c @@ -262,7 +262,7 @@ PHPSTR_API size_t phpstr_chunk_buffer(phpstr **s, const char *data, size_t data_ if (!chunk_size) { phpstr_data(storage, chunk, &chunk_size); - phpstr_free(&storage); + phpstr_free(s); return chunk_size; } @@ -288,6 +288,8 @@ PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_ data = NULL; data_len = 0; if (!chunk_len) { + /* we already got the last chunk, + and freed all resources */ break; } }