projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- ditch http_split_response()
[m6w6/ext-http]
/
phpstr
/
phpstr.c
diff --git
a/phpstr/phpstr.c
b/phpstr/phpstr.c
index 8d8df3ea25f383cf1e9ec1efe9f0b73d495a4654..acee06fde4df9f39197b3302a79c1811d307f4c5 100644
(file)
--- a/
phpstr/phpstr.c
+++ b/
phpstr/phpstr.c
@@
-235,19
+235,17
@@
PHPSTR_API int phpstr_cmp(phpstr *left, phpstr *right)
PHPSTR_API void phpstr_dtor(phpstr *buf)
{
PHPSTR_API void phpstr_dtor(phpstr *buf)
{
- if (buf->data) {
- efree(buf->data);
- buf->data = NULL;
- }
+ STR_SET(buf->data, NULL);
buf->used = 0;
buf->free = 0;
}
buf->used = 0;
buf->free = 0;
}
-PHPSTR_API void phpstr_free(phpstr *buf)
+PHPSTR_API void phpstr_free(phpstr *
*
buf)
{
{
- if (buf) {
- phpstr_dtor(buf);
- efree(buf);
+ if (*buf) {
+ phpstr_dtor(*buf);
+ efree(*buf);
+ *buf = NULL;
}
}
}
}