]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] Consistently use error in tcp_parse_tcp_req()
authorSimon Horman <horms@verge.net.au>
Fri, 15 Jul 2011 04:14:06 +0000 (13:14 +0900)
committerWilly Tarreau <w@1wt.eu>
Mon, 18 Jul 2011 08:21:23 +0000 (10:21 +0200)
It seems to me that without this change tcp_parse_tcp_req()
may leak memory.

src/proto_tcp.c

index cdaf1503208416b46f510b9a7cdd9ddeb595e0bf..3b6d39d3868c2d5fbfc89322ebd110297be58bf3 100644 (file)
@@ -1213,7 +1213,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                if (!(curpx->cap & PR_CAP_FE)) {
                        snprintf(err, errlen, "%s %s is not allowed because %s %s is not a frontend",
                                 args[0], args[1], proxy_type_str(curpx), curpx->id);
-                       return -1;
+                       goto error;
                }
 
                if (tcp_parse_request_rule(args, arg, section_type, curpx, defpx, rule, err, errlen) < 0)