CLEANUP: checks: do not allocate a connection for process checks
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Oct 2017 13:25:38 +0000 (15:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Oct 2017 13:25:38 +0000 (15:25 +0200)
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

index 3284b53..04780de 100644 (file)
@@ -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";
        }