mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-15 18:17:01 +00:00
BUG/MINOR: tcp-rules: Fix memory releases on error path during action parsing
When an error occurred during the parsing of a TCP action, if some memory was allocated, it should be released before exiting. Here, the fix consists for replace a call to free() on a sample expression by a call to release_sample_expr(). This patch may be backported to all supported versions.
This commit is contained in:
parent
adfc6e8e14
commit
fdb6fbfa9a
@ -770,7 +770,7 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type,
|
|||||||
memprintf(err,
|
memprintf(err,
|
||||||
"'%s %s %s' : fetch method '%s' extracts information from '%s', none of which is available here",
|
"'%s %s %s' : fetch method '%s' extracts information from '%s', none of which is available here",
|
||||||
args[0], args[1], args[kw], args[arg-1], sample_src_names(expr->fetch->use));
|
args[0], args[1], args[kw], args[arg-1], sample_src_names(expr->fetch->use));
|
||||||
free(expr);
|
release_sample_expr(expr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -780,7 +780,7 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type,
|
|||||||
memprintf(err,
|
memprintf(err,
|
||||||
"'%s %s %s' : missing length value",
|
"'%s %s %s' : missing length value",
|
||||||
args[0], args[1], args[kw]);
|
args[0], args[1], args[kw]);
|
||||||
free(expr);
|
release_sample_expr(expr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* we copy the table name for now, it will be resolved later */
|
/* we copy the table name for now, it will be resolved later */
|
||||||
@ -789,7 +789,7 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type,
|
|||||||
memprintf(err,
|
memprintf(err,
|
||||||
"'%s %s %s' : length must be > 0",
|
"'%s %s %s' : length must be > 0",
|
||||||
args[0], args[1], args[kw]);
|
args[0], args[1], args[kw]);
|
||||||
free(expr);
|
release_sample_expr(expr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
arg++;
|
arg++;
|
||||||
@ -851,7 +851,7 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type,
|
|||||||
memprintf(err,
|
memprintf(err,
|
||||||
"'%s %s %s' : fetch method '%s' extracts information from '%s', none of which is available here",
|
"'%s %s %s' : fetch method '%s' extracts information from '%s', none of which is available here",
|
||||||
args[0], args[1], args[kw], args[arg-1], sample_src_names(expr->fetch->use));
|
args[0], args[1], args[kw], args[arg-1], sample_src_names(expr->fetch->use));
|
||||||
free(expr);
|
release_sample_expr(expr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -864,7 +864,7 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type,
|
|||||||
memprintf(err,
|
memprintf(err,
|
||||||
"'%s %s %s' : missing table name",
|
"'%s %s %s' : missing table name",
|
||||||
args[0], args[1], args[kw]);
|
args[0], args[1], args[kw]);
|
||||||
free(expr);
|
release_sample_expr(expr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* we copy the table name for now, it will be resolved later */
|
/* we copy the table name for now, it will be resolved later */
|
||||||
|
Loading…
Reference in New Issue
Block a user