From: Willy Tarreau Date: Wed, 4 Oct 2017 13:25:38 +0000 (+0200) Subject: CLEANUP: checks: do not allocate a connection for process checks X-Git-Tag: v1.8-dev3~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b398e643d44565d1a10f772186aa1f92d9c375d1;p=thirdparty%2Fhaproxy.git CLEANUP: checks: do not allocate a connection for process checks Since this connection is not used at all anymore, do not allocate it. It was verified that check successes and failures (both synchronous and asynchronous) continue to be properly reported. --- diff --git a/src/checks.c b/src/checks.c index 3284b53f39..04780de257 100644 --- a/src/checks.c +++ b/src/checks.c @@ -2964,8 +2964,8 @@ const char *init_check(struct check *check, int type) } check->bo->size = global.tune.chksize; - /* Allocate buffer for partial results... */ - if ((check->conn = calloc(1, sizeof(struct connection))) == NULL) { + if (check->type != PR_O2_EXT_CHK && + (check->conn = calloc(1, sizeof(struct connection))) == NULL) { return "out of memory while allocating check connection"; }