This adjusts a few locations to make use of `isttest()` and `istfree()`.
}
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
goto out;
- free(curapp->docroot.ptr);
+ istfree(&curapp->docroot);
curapp->docroot = ist2(strdup(args[1]), strlen(args[1]));
- if (!curapp->docroot.ptr) {
+ if (!isttest(curapp->docroot)) {
ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
}
}
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
goto out;
- free(curapp->index.ptr);
+ istfree(&curapp->index);
curapp->index = ist2(strdup(args[1]), strlen(args[1]));
- if (!curapp->index.ptr) {
+ if (!isttest(curapp->index)) {
ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
}
struct fcgi_rule_conf *rule, *back;
free(curapp->name);
- free(curapp->docroot.ptr);
- free(curapp->index.ptr);
+ istfree(&curapp->docroot);
+ istfree(&curapp->index);
regex_free(curapp->pathinfo_re);
free(curapp->conf.file);
lua_settable(L, -3);
path = http_get_path(htx_sl_req_uri(sl));
- if (path.ptr) {
+ if (isttest(path)) {
char *p, *q, *end;
p = path.ptr;
}
value = hpack_alloc_string(tmp, idx, hpack_idx_to_value(dht, idx));
- if (!value.ptr) {
+ if (!isttest(value)) {
hpack_debug_printf("##ERR@%d##\n", __LINE__);
ret = -HPACK_ERR_TOO_LARGE;
goto leave;
if (!name.len) {
name = hpack_alloc_string(tmp, idx, hpack_idx_to_name(dht, idx));
- if (!name.ptr) {
+ if (!isttest(name)) {
hpack_debug_printf("##ERR@%d##\n", __LINE__);
ret = -HPACK_ERR_TOO_LARGE;
goto leave;
if (!name.len) {
name = hpack_alloc_string(tmp, idx, hpack_idx_to_name(dht, idx));
- if (!name.ptr) {
+ if (!isttest(name)) {
hpack_debug_printf("##ERR@%d##\n", __LINE__);
ret = -HPACK_ERR_TOO_LARGE;
goto leave;
}
hpack_debug_printf("\e[1;34m%s\e[0m: ",
- name.ptr ? istpad(trash.area, name).ptr : h2_phdr_to_str(name.len));
+ isttest(name) ? istpad(trash.area, name).ptr : h2_phdr_to_str(name.len));
hpack_debug_printf("\e[1;35m%s\e[0m [mustidx=%d, used=%d] [n=(%p,%d) v=(%p,%d)]\n",
istpad(trash.area, value).ptr, must_index,
{
struct logformat_node *lf, *lfb;
- if (rule->arg.http.str.ptr)
- free(rule->arg.http.str.ptr);
+ istfree(&rule->arg.http.str);
if (rule->arg.http.re)
regex_free(rule->arg.http.re);
list_for_each_entry_safe(lf, lfb, &rule->arg.http.fmt, list) {
cur_arg++;
if (!parse_logformat_string(args[cur_arg], px, &rule->arg.http.fmt, LOG_OPT_HTTP, cap, err)) {
- free(rule->arg.http.str.ptr);
+ istfree(&rule->arg.http.str);
return ACT_RET_PRS_ERR;
}
cur_arg++;
if (!(rule->arg.http.re = regex_comp(args[cur_arg], 1, 1, err))) {
- free(rule->arg.http.str.ptr);
+ istfree(&rule->arg.http.str);
return ACT_RET_PRS_ERR;
}
cur_arg++;
if (!parse_logformat_string(args[cur_arg], px, &rule->arg.http.fmt, LOG_OPT_HTTP, cap, err)) {
- free(rule->arg.http.str.ptr);
+ istfree(&rule->arg.http.str);
regex_free(rule->arg.http.re);
return ACT_RET_PRS_ERR;
}
free(lf->arg);
free(lf);
}
- free(hdr->name.ptr);
+ istfree(&hdr->name);
free(hdr);
}
free(rule->arg.http_return.hdrs);
free(lf->arg);
free(lf);
}
- free(hdr->name.ptr);
+ istfree(&hdr->name);
free(hdr);
}
}
free(lf->arg);
free(lf);
}
- free(hdr->name.ptr);
+ istfree(&hdr->name);
free(hdr);
}
}
free(lf->arg);
free(lf);
}
- free(hdr->name.ptr);
+ istfree(&hdr->name);
free(hdr);
}
free(hdrs);
sl = http_get_stline(htx);
path = http_get_path(htx_sl_req_uri(sl));
/* build message using path */
- if (path.ptr) {
+ if (isttest(path)) {
if (rule->flags & REDIRECT_FLAG_DROP_QS) {
int qs = 0;
while (qs < path.len) {
sl = http_get_stline(htx);
path = http_get_path(htx_sl_req_uri(sl));
/* build message using path */
- if (path.ptr) {
+ if (isttest(path)) {
if (rule->flags & REDIRECT_FLAG_DROP_QS) {
int qs = 0;
while (qs < path.len) {
htx = htxbuf(&req->buf);
sl = http_get_stline(htx);
path = http_get_path(htx_sl_req_uri(sl));
- if (!path.ptr)
+ if (!isttest(path))
return;
if (!chunk_memcat(&trash, path.ptr, path.len))
sl = http_get_stline(htx);
path = iststop(http_get_path(htx_sl_req_uri(sl)), '?');
- if (!path.ptr)
+ if (!isttest(path))
return 0;
/* OK, we got the '/' ! */
/* now retrieve the path */
sl = http_get_stline(htx);
path = http_get_path(htx_sl_req_uri(sl));
- if (path.ptr) {
+ if (isttest(path)) {
size_t len;
for (len = 0; len < path.len && *(path.ptr + len) != '?'; len++)
/* now retrieve the path */
sl = http_get_stline(htx);
path = http_get_path(htx_sl_req_uri(sl));
- if (path.ptr) {
+ if (isttest(path)) {
size_t len;
for (len = 0; len < path.len && *(path.ptr + len) != '?'; len++)
path.len = ptr - path.ptr;
path = http_get_path(path);
- if (!path.ptr)
+ if (!isttest(path))
return 0;
smp->data.u.str.area = path.ptr;
if (blk) {
char *p;
- if (!ctx->value.ptr)
+ if (!isttest(ctx->value))
goto rescan_hdr;
if (full)
goto next_blk;
uri = htx_sl_req_uri(sl);
p = http_get_path(uri);
- if (!p.ptr)
+ if (!isttest(p))
p = uri;
while (plen < p.len && *(p.ptr + plen) != '?')
plen++;
entry->name.len = strlen(to);
if (!entry->node.key || !entry->name.ptr) {
free(entry->node.key);
- free(entry->name.ptr);
+ istfree(&entry->name);
free(entry);
memprintf(err, "out of memory");
return -1;
ebpt_delete(node);
entry = container_of(node, struct h1_hdr_entry, node);
free(entry->node.key);
- free(entry->name.ptr);
+ istfree(&entry->name);
free(entry);
node = next;
}