projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- fix dep on SPL in PHP-5.1
[m6w6/ext-http]
/
phpstr
/
phpstr.c
diff --git
a/phpstr/phpstr.c
b/phpstr/phpstr.c
index f9ae25c41440d8817bcd01028c69999993b6cbc2..c0d9543f3d3e4a7e5b11b9d20b3aee68f3632c04 100644
(file)
--- 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);
if (!chunk_size) {
phpstr_data(storage, chunk, &chunk_size);
- phpstr_free(
&storage
);
+ phpstr_free(
s
);
return chunk_size;
}
return chunk_size;
}
@@
-284,13
+284,16
@@
PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_
while (got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len)) {
passthru(chunk, got TSRMLS_CC);
while (got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len)) {
passthru(chunk, got TSRMLS_CC);
- efree(chunk);
- data = NULL;
- data_len = 0;
if (!chunk_len) {
if (!chunk_len) {
+ /* we already got the last chunk,
+ and freed all resources */
break;
}
break;
}
+ data = NULL;
+ data_len = 0;
+ STR_SET(chunk, NULL);
}
}
+ STR_FREE(chunk);
}
/*
}
/*