From b398e643d44565d1a10f772186aa1f92d9c375d1 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 4 Oct 2017 15:25:38 +0200 Subject: [PATCH] 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. --- src/checks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checks.c b/src/checks.c index 3284b53f3..04780de25 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"; }