strncmp(var, logformat_keywords[j].name, var_len) == 0) {
if (logformat_keywords[j].mode != PR_MODE_HTTP || curproxy->mode == PR_MODE_HTTP) {
node = calloc(1, sizeof(*node));
+ if (!node) {
+ Alert("Out of memory error.\n");
+ return 0;
+ }
node->type = logformat_keywords[j].type;
node->options = *defoptions;
if (arg_len) {
if (type == LF_TEXT) { /* type text */
struct logformat_node *node = calloc(1, sizeof(*node));
+ if (!node) {
+ Alert("Out of memory error.\n");
+ return 0;
+ }
str = calloc(1, end - start + 1);
strncpy(str, start, end - start);
str[end - start] = '\0';
LIST_ADDQ(list_format, &node->list);
} else if (type == LF_SEPARATOR) {
struct logformat_node *node = calloc(1, sizeof(*node));
+ if (!node) {
+ Alert("Out of memory error.\n");
+ return 0;
+ }
node->type = LOG_FMT_SEPARATOR;
LIST_ADDQ(list_format, &node->list);
}
}
node = calloc(1, sizeof(*node));
+ if (!node) {
+ Alert("Out of memory error.\n");
+ return 0;
+ }
node->type = LOG_FMT_EXPR;
node->expr = expr;
node->options = options;
struct logformat_node *tmplf, *back;
sp = str = backfmt = strdup(fmt);
+ if (!str) {
+ Alert("Out of memory error.\n");
+ return 0;
+ }
curproxy->to_log |= LW_INIT;
/* flush the list first. */