- while (got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len)) {
- passthru(chunk, got TSRMLS_CC);
- efree(chunk);
+ while ((got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len))) {
+ passthru(opaque, chunk, got TSRMLS_CC);
+ if (!chunk_len) {
+ /* we already got the last chunk,
+ and freed all resources */
+ break;
+ }